poloclub / cnn-explainer

Learning Convolutional Neural Networks with Interactive Visualization.
https://poloclub.github.io/cnn-explainer/
MIT License
8.1k stars 1.22k forks source link

Error in running tiny-vgg.py #21

Closed ScorpLee closed 4 years ago

ScorpLee commented 4 years ago

Hi,

I ran the tiny-vgg.py following the conda env (supposedly all dependencies are installed), and I got error like below. ValueError: Input 0 of layer sequential is incompatible with the layer: its rank is undefined, but the layer requires a defined rank. I'm seeking your thoughts on what is going on. No one else seems have this issue. Thanks for your time answering this.

xiaohk commented 4 years ago

Hello @ScorpLee, I just tested to run tiny-vgg.py on 758064d9b4121cac14a76f490a39ed61742d6186 on macOS, and I couldn't reproduce the error.

Could you please copy the commands you have run and the error log here? It can help us better troubleshoot it 😃

ScorpLee commented 4 years ago

Hi,

I ran it on Linux Ubuntu 16.04.6. Please see below screen shot. Thanks for helping. [cid:image002.png@01D6750A.F04F2610]

Kind regards,

From: Jay Wangmailto:notifications@github.com Sent: Sunday, 16 August 2020 6:17 AM To: poloclub/cnn-explainermailto:cnn-explainer@noreply.github.com Cc: ScorpLeemailto:yzha4885@outlook.com; Mentionmailto:mention@noreply.github.com Subject: Re: [poloclub/cnn-explainer] Error in running tiny-vgg.py (#21)

Hello @ScorpLeehttps://github.com/ScorpLee, I just tested to run tiny-vgg.py on 758064dhttps://github.com/poloclub/cnn-explainer/commit/758064d9b4121cac14a76f490a39ed61742d6186 on macOS, and I couldn't reproduce the error.

Could you please copy the commands you have run and the error log here? It can help us better troubleshoot it 😃

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/poloclub/cnn-explainer/issues/21#issuecomment-674443084, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOUXT5YGBFSTTVHZSR3KEQDSA3UNBANCNFSM4P2B7YEA.

xiaohk commented 4 years ago

Oops, the screenshot didn't show up in the thread. Maybe you can try to upload it through the GitHub issue website?

ScorpLee commented 4 years ago

Hi, I think it has something to do with the system. Maybe I didn't set up the environment properly. I noticed the environment.yaml only has mac-os and windows version. I ran it on windows, too and it was fine. Just wondering if the trained test accuracy is around 67.2000 and test loss 1.1124? I'm not 100% confident.

The command was: python tiny-vgg.py.

ValueError: in converted code:

tiny-vgg.py:223 train_step *
    predictions = tiny_vgg(image_batch)
/usr/local/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py:586 __call__
    self.name)
/usr/local/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/input_spec.py:111 assert_input_compatibility
    layer_name + ' is incompatible with the layer: '

ValueError: Input 0 of layer sequential is incompatible with the layer: its rank is undefined, but the layer requires a defined rank.
xiaohk commented 4 years ago

Thanks! Yes, the test accuracy and loss look correct :)

I just tested tiny-vgg.py on Ubuntu 16.04.3 and it worked fine. Could you please double check you are using the latest environment.yaml? I have updated it on the master branch few weeks ago. This environment file should work across different operating systems.

xiaohk commented 4 years ago

Hey @ScorpLee , I will close the issue for now. Let me know if https://github.com/poloclub/cnn-explainer/issues/21#issuecomment-675150442 didn't help you fix the issue.