Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load weights for finetune (likely because you are finetuning a previously finetuned network). Attempting to finetune from a full finetune model file. #124

Closed
yuan0821 opened this issue Sep 15, 2022 · 1 comment

Comments

@yuan0821
Copy link

Hi.
I try to use a pre-trained 3 camera weights.:[https://www.dropbox.com/s/2fama0q45sdzwfj/weights_multigpu.30-0.00002.hdf5?dl=0] to finetune our data. I have 150 frames hand-labeled COM file, trained COM from scratch, and completed com-predict.
Now I performed dannce-train with 30-frames hand labels and trained from finetuning network using pre-trained 3 camera weight. the weight loading error occurs, could you please help to fix it? Thank you.
dannce_config_907.txt
io.txt

`Correcting mismatch in layer name, model: image_input, weights: input_1
Could not load weights for finetune (likely because you are finetuning a previously finetuned network). Attempting to finetune from a full finetune model file.
Traceback (most recent call last):
File "f:\dannce\dannce\interface.py", line 1120, in dannce_train
*fargs
File "f:\dannce\dannce\engine\nets.py", line 1129, in finetune_AVG
model = renameLayers(model, weightspath)
File "f:\dannce\dannce\engine\nets.py", line 1348, in renameLayers
model.load_weights(weightspath, by_name=True)
File "E:\Anaconda3_202111\envs\dannce\lib\site-packages\tensorflow\python\keras\engine\training.py", line 2319, in load_weights
f, self.layers, skip_mismatch=skip_mismatch)
File "E:\Anaconda3_202111\envs\dannce\lib\site-packages\tensorflow\python\keras\saving\hdf5_format.py", line 768, in load_weights_from_hdf5_group_by_name
layer, weight_values, original_keras_version, original_backend)
File "E:\Anaconda3_202111\envs\dannce\lib\site-packages\tensorflow\python\keras\saving\hdf5_format.py", line 404, in preprocess_weights_for_loading
weights[0] = np.transpose(weights[0], (3, 2, 0, 1))
File "<array_function internals>", line 6, in transpose
File "E:\Anaconda3_202111\envs\dannce\lib\site-packages\numpy\core\fromnumeric.py", line 653, in transpose
return _wrapfunc(a, 'transpose', axes)
File "E:\Anaconda3_202111\envs\dannce\lib\site-packages\numpy\core\fromnumeric.py", line 58, in _wrapfunc
return bound(*args, **kwds)
ValueError: axes don't match array

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:\Anaconda3_202111\envs\dannce\Scripts\dannce-train-script.py", line 33, in
sys.exit(load_entry_point('dannce', 'console_scripts', 'dannce-train')())
File "f:\dannce\dannce\cli.py", line 66, in dannce_train_cli
dannce_train(params)
File "f:\dannce\dannce\interface.py", line 1126, in dannce_train
*fargs
File "f:\dannce\dannce\engine\nets.py", line 1205, in finetune_fullmodel_AVG
for layer in model.layers[1].layers:
AttributeError: 'Conv3D' object has no attribute 'layers'`

@yuan0821 yuan0821 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2022
@yuan0821 yuan0821 reopened this Oct 24, 2022
@spoonsso
Copy link
Owner

spoonsso commented May 3, 2023

Duplicate of #129 ?

@spoonsso spoonsso closed this as completed May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants