SirisAvishek / Attention_Shift_Ranks

29 stars 3 forks source link

ASSRNet.H5 mismatch #11

Closed ChenShu1999 closed 10 months ago

ChenShu1999 commented 10 months ago

hi, I wanted to use the weights you provided to generate predicted Saliency Rank Maps, but during runtime, I found that the weights did not match and the following error occurred:

Loading weights weights/ASSRNet.H5 Traceback (most recent call last): File "/home/u/tmp/ijcv/predict_and_generate_saliency_map.py", line 48, in model.load_weights(weight_file, by_name=True) File "/home/u/tmp/ijcv/model/ASSRNet.py", line 325, in load_weights hdf5_format.load_weights_from_hdf5_group_by_name(f, layers) File "/opt/conda/envs/ijcv/lib/python3.8/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 783, in load_weights_from_hdf5_group_by_name raise ValueError('Layer #' + str(k) +' (named "' + layer.name + ValueError: Layer #393 (named "obj_feat_reduce_conv1"), weight <tf.Variable 'obj_feat_reduce_conv1/kernel:0' shape=(1, 1, 1024, 512) dtype=float32> has shape (1, 1, 1024, 512), but the saved weight has shape (448, 1024, 1, 1).

SirisAvishek commented 10 months ago

@ChenShu1999

Hi, I have updated the code and weight file. They should be working correctly now.