Closed bluelight773 closed 6 years ago
I have updated the _keras.json.forTheano template in the repo to the latest Keras format. If you download the new file, rename it as "keras.json" and put it in the .keras folder in place of the old one the issue should hopefully disappear.
I had the same error.
I added this to the import section of vgg16.py:
from keras import backend as K K.set_image_dim_ordering('th')
fixed the problem :)
There is also this pull request in the main fastai repo:
https://github.com/fastai/courses/commit/5efc3c79d5b0b9f0cd21373b0ef17612864ea721
I updated the keras.json for Theano anyway, since the previous version in my repo was obsolete. Many thanks @vteodorescu for adding your suggestion.
I spoke too early - I passed over the shape issue, now I get an 'out of memory' error...
I have 4GB of GPU memory and 8GB of RAM memory
Back to do more research, I will try and use vgg16 straight from the keras repo, see if it helps
I assume you already tested reducing the batch size, otherwise it would be worth a try.
On 27 Sep 2017, at 19:13, Viorel Emilian Teodorescu notifications@github.com wrote:
I spoke too early - I passed over the shape issue, now I get an 'out of memory' error...
I have 4GB of GPU memory and 8GB of RAM memory
Back to do more research, I will try and use vgg16 straight from the keras repo, see if it helps
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.
"slaps forehead v hard... :) "...
I did not try it before you mentioned, thank you for the tip, roebius! I was getting version fatigue a bit.
Dropped to batches = 16 and it did run finally. With batches 32 it ran out of memory on the last iteration... :) :) :)
On to the next challenge!
All the best!
I ran lesson 1 on AWS p2.xlarge instance and the following error pops up:
ImportError Traceback (most recent call last)
SpatialDropout1D was introduced with Keras 2. Could you check which version of Keras you have installed?
In order to get the version launch Python in a terminal session and type the following:
import keras
print(keras.__version__)
If you have the right version of Keras then the following should work too:
from keras.layers import SpatialDropout1D
Thanks for the quick response! I update Keras to 2.08 on AWS and I get the following error now:
ValueError Traceback (most recent call last)
Check your keras.json file: it looks like in your case it contains settings for TensorFlow instead of Theano. Look also at my first comment in this thread.
@hamedkhanpour Not related to the last error that you experienced above: I have noted from your ValueError Traceback that you are using Python 2.7. Please keep in mind that the notebooks in my repo have been tested with Python 3.5 on Ubuntu 16.04 (part 1 and 2) and Python 3.6 on Mac OSX 10.12.5 (part 1 only). I have no plans involving the use of Python 2.
Following installation of all requirements for Part 1 on Ubuntu 16 / Python 3.5:
If I just go through lesson1.ipynb (part 1), which has the dogscats path, as soon as I try to execute
vgg=Vgg16()
I get the error below: