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

ValueError: axes don't match array #1

Open
zhilaAI opened this issue Sep 17, 2020 · 5 comments
Open

ValueError: axes don't match array #1

zhilaAI opened this issue Sep 17, 2020 · 5 comments

Comments

@zhilaAI
Copy link

zhilaAI commented Sep 17, 2020

File "./predict.py", line 95, in
modelRecoverCombine = model.model.build_combine_model()
File "/home/zhila/Project/Research_Journal/JSTASR-DesnowNet-ECCV-2020/model/model.py", line 192, in build_combine_model
modelSnow.load_weights('./modelParam/snowmodel.h5',by_name=False)
File "/home/zhila/.local/lib/python3.6/site-packages/keras/engine/saving.py", line 492, in load_wrapper
return load_function(*args, **kwargs)
File "/home/zhila/.local/lib/python3.6/site-packages/keras/engine/network.py", line 1230, in load_weights
f, self.layers, reshape=reshape)
File "/home/zhila/.local/lib/python3.6/site-packages/keras/engine/saving.py", line 1224, in load_weights_from_hdf5_group
reshape=reshape)
File "/home/zhila/.local/lib/python3.6/site-packages/keras/engine/saving.py", line 861, in preprocess_weights_for_loading
weights = convert_nested_model(weights)
File "/home/zhila/.local/lib/python3.6/site-packages/keras/engine/saving.py", line 836, in convert_nested_model
original_backend=original_backend))
File "/home/zhila/.local/lib/python3.6/site-packages/keras/engine/saving.py", line 980, in preprocess_weights_for_loading
weights[0] = np.transpose(weights[0], (3, 2, 0, 1))
File "<array_function internals>", line 6, in transpose
File "/home/zhila/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 653, in transpose
return _wrapfunc(a, 'transpose', axes)
File "/home/zhila/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 58, in _wrapfunc
return bound(*args, **kwds)
ValueError: axes don't match array

@zhilaAI
Copy link
Author

zhilaAI commented Sep 17, 2020

Can you please help me?

@cctakaet
Copy link

Are you running the following command?
python ./predict.py -dataroot ./testImg -predictpath ./p -batch_size 3

If so, do you modify predict.py ?
I can't reproduce your issue so I would need more detail.

@zhilaAI
Copy link
Author

zhilaAI commented Sep 28, 2020 via email

@cctakaet
Copy link

It seems to be an issue of keras/tf.
keras-team/keras#13279

Could you try TensorFlow 1.12.0 ? We actually use this verion for training and testing.
If you want to use docker, we already have docker image on docker hub.
You can get it by docker pull cctakaet/jstasr:latest .

@zhilaAI
Copy link
Author

zhilaAI commented Sep 29, 2020 via email

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