imatge-upc / detection-2016-nipsws

Hierarchical Object Detection with Deep Reinforcement Learning
http://imatge-upc.github.io/detection-2016-nipsws/
MIT License
423 stars 129 forks source link

ValueError: You are trying to load a weight file containing 0 layers into a model with 16 layers. #35

Open cfortunylombra opened 3 years ago

cfortunylombra commented 3 years ago

When I run the code, it stops at this line:

https://github.com/imatge-upc/detection-2016-nipsws/blob/dbcc3ac46b4e2a8841eadd1cbc46ee58c6d9a2a8/scripts/image_zooms_training.py#L76

The error message is the following:

Traceback (most recent call last):

  File "E:\EUMETSAT\UPC\scripts\image_zooms_training.py", line 76, in <module>
    model_vgg = obtain_compiled_vgg_16(path_vgg)

  File "E:\EUMETSAT\UPC\scripts\features.py", line 251, in obtain_compiled_vgg_16
    model = vgg_16(vgg_weights_path)

  File "E:\EUMETSAT\UPC\scripts\features.py", line 304, in vgg_16
    model.load_weights(weights_path)

  File "E:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py", line 2211, in load_weights
    hdf5_format.load_weights_from_hdf5_group(f, self.layers)

  File "E:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\keras\saving\hdf5_format.py", line 686, in load_weights_from_hdf5_group
    ' layers.')

ValueError: You are trying to load a weight file containing 0 layers into a model with 16 layers.

Does anyone know how to fix this issue?

ruffiann commented 2 years ago

Hi, I'm running this code but I'm having problems configuring the environment due to different versions, can I ask you what the environment and package version is when you run this code? For example, can I ask you the version of cuda, gcc, python?