francesclluis/sound-field-neural-network

Issue when running pretrained model

Closed this issue · 4 comments

Hi,

Thank you for sharing such a nice project !

I tried running it with the pre-trained model by doing:

python main.py --mode real-eval --config sessions/session_0/config.json

and get the following error:

ValueError: Layer #0 (named "encoder_partialconv_0" in the current model) was found to correspond to layer p_conv2d_9 in the save file. However the new layer encoder_partialconv_0 expects 3 weights, but the saved weights have 2 elements.

(of course it occurs in sim-eval and visualize modes too)

Am I missing something?

Hi!
Thanks for your interest!

Make sure you use keras 2.2.4 in your conda environment. You can install it by running conda install -c conda-forge keras==2.2.4
I get your error when running the code using keras 2.3.1. You can check your version by running python -c 'import keras; print(keras.__version__)'

Let me know if that works

Hi,

Thank you for your answer, your fix worked. I was indeed using Keras 2.3.1.

So the pretrained model is the same as the one you used in the paper?

PS: I followed these instructions https://github.com/francesclluis/sound-field-neural-network/issues/1 to setup my environment, it might worth to edit your reply there so other people install Keras 2.2.4 direclty

Hi,

I'm glad the fix worked and I just changed the instructions accordingly:)
Yes, the pretrained model is the same as the one used in the paper

Awesome, thanks !