d4nst / RotNet

https://d4nst.github.io/2017/01/12/image-orientation/
MIT License
534 stars 186 forks source link

ValueError: Unknown layer: Merge #28

Open Firas-Zarai opened 4 years ago

Firas-Zarai commented 4 years ago

when I'm trying to load the pre-trained model"rotnet_street_view_resnet50.hdf5" provided on the google drive file I go these error fff

d4nst commented 4 years ago

I'm not sure, it's been a while since I don't use Keras. Maybe you are using an incompatible version?

hbasafa commented 4 years ago

I faced this problem, too. I exactly installed dependencies as printed in requirements.txt. any solution?

d4nst commented 4 years ago

It looks like the version in the requirements is wrong. See these issues: https://github.com/keras-team/keras/issues/10377 and https://github.com/orobix/retina-unet/issues/55

So please try downgrading Keras version to fix it. I would suggest you try Keras 1.2.2 since that was the last version before Keras 2 and the code was written before Keras 2 was released. If that works, please leave a comment here, or even better, submit a PR to change the version in requirements.txt so that other people don't face this issue.

crameth commented 4 years ago

Your requirements listed version 2.3.0 of Keras though.

If I am not wrong, we just have to go through the training process to obtain a model that is compatible with version 2 of Keras. Your pre-trained model was probably generated from an older version of Keras (< v2) and thus is incompatible with version 2.3.0.

crameth commented 4 years ago

Tried with 1.2.2, but results in TensorFlow compatibility issue:

AttributeError: module 'tensorflow' has no attribute 'placeholder'

Should be easily resolved by downgrading TensorFlow as well... or just re-train the model using the new versions of Keras and TF.

Edit: Resolved TF compatibility issue by downgrading to 1.15. Note that TF 1.15 is incompatible with CUDA 10.2.

Aravinda89 commented 4 years ago

Download and use pretrained model 'rotnet_street_view_resnet50_keras2.hdf5' , it works ! https://drive.google.com/open?id=0B9eNEi5uvOI1SjQ5M2tQY3ZMM1U