deepgram / kur

Descriptive Deep Learning
Apache License 2.0
816 stars 107 forks source link

Unable to train mnist model #37

Closed josh-gree closed 7 years ago

josh-gree commented 7 years ago

Hi I am trying to run the example mnist model and I get the following error;

[INFO 2017-03-15 14:43:14,295 kur.model.model:280] Connecting the model graph. [DEBUG 2017-03-15 14:43:14,295 kur.model.model:311] Building node: images [DEBUG 2017-03-15 14:43:14,295 kur.model.model:312] Aliases: images [DEBUG 2017-03-15 14:43:14,295 kur.model.model:313] Inputs: [DEBUG 2017-03-15 14:43:14,295 kur.containers.layers.placeholder:116] Creating placeholder for "images" with data type "float32". [DEBUG 2017-03-15 14:43:14,295 kur.model.model:125] Trying to infer shape for input "images" [DEBUG 2017-03-15 14:43:14,295 kur.model.model:143] Inferred shape for input "images": (28, 28, 1) [DEBUG 2017-03-15 14:43:14,295 kur.containers.layers.placeholder:126] Inferred shape: (28, 28, 1) [DEBUG 2017-03-15 14:43:14,305 kur.model.model:382] Value: Tensor("images:0", shape=(?, 28, 28, 1), dtype=float32) [DEBUG 2017-03-15 14:43:14,306 kur.model.model:311] Building node: ..convolution.0 [DEBUG 2017-03-15 14:43:14,306 kur.model.model:312] Aliases: ..convolution.0 [DEBUG 2017-03-15 14:43:14,306 kur.model.model:313] Inputs: [DEBUG 2017-03-15 14:43:14,306 kur.model.model:315] - images: Tensor("images:0", shape=(?, 28, 28, 1), dtype=float32) [WARNING 2017-03-15 14:43:14,306 py.warnings:86] /home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/keras/legacy/interfaces.py:86: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(strides=[1, 1], activation="linear", name="..convolution.0", padding="same", kernel_size=(2, 2), filters=64) '` call to the Keras 2 API: ' + signature)

Traceback (most recent call last): File "/home/josh/anaconda/envs/tensorflow/bin/kur", line 11, in sys.exit(main()) File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/kur/main.py", line 269, in main sys.exit(args.func(args) or 0) File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/kur/main.py", line 48, in train func = spec.get_training_function() File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/kur/kurfile.py", line 282, in get_training_function model = self.get_model(provider) File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/kur/kurfile.py", line 148, in get_model self.model.build() File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/kur/model/model.py", line 282, in build self.build_graph(input_nodes, output_nodes, network) File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/kur/model/model.py", line 339, in build_graph target=layer File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/kur/backend/keras_backend.py", line 238, in connect return target(inputs) File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/keras/engine/topology.py", line 545, in call output = self.call(inputs, **kwargs) File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/keras/layers/convolutional.py", line 164, in call dilation_rate=self.dilation_rate) File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 2856, in conv2d x = _preprocess_conv2d_input(x, data_format) File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 2729, in _preprocess_conv2d_input if dtype(x) == 'float64': File "/home/josh/anaconda/envs/tensorflow/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 470, in dtype return x.dtype.name AttributeError: 'list' object has no attribute 'dtype'

It is probably an issue with my setup so here is my enviroment;

appdirs 1.4.0 astra-toolbox 1.8 np111py35_1 astra-toolbox blas 1.1 openblas conda-forge bleach 1.5.0 py35_0 conda-forge ca-certificates 2016.9.26 0 conda-forge cairo 1.14.6 0 conda-forge certifi 2016.9.26 py35_0 conda-forge click 6.7 py35_0 conda-forge cycler 0.10.0 py35_0 conda-forge dbus 1.10.10 1 conda-forge decorator 4.0.11 py35_0 conda-forge entrypoints 0.2.2 py35_1 conda-forge expat 2.1.0 2 conda-forge flask 0.11.1 py35_0 conda-forge flask-mongo-sessions 0.2.1 Flask-PyMongo 0.4.1 fontconfig 2.11.1 6 conda-forge freetype 2.6.3 1 conda-forge future 0.15.2 py35_0 conda-forge gettext 0.19.7 1 conda-forge glib 2.51.0 2 conda-forge gmp 6.1.2 0 conda-forge gst-plugins-base 1.8.0 0 conda-forge gstreamer 1.8.0 1 conda-forge h5py 2.6.0 np111py35_7 conda-forge harfbuzz 1.3.4 0 conda-forge hdf5 1.8.17 9 conda-forge html5lib 0.999 py35_0 icu 56.1 4 conda-forge ipykernel 4.5.2 py35_0 conda-forge ipython 5.1.0 py35_2 conda-forge ipython_genutils 0.1.0 py35_0 conda-forge itsdangerous 0.24 py35_0 conda-forge jinja2 2.8 py35_1 conda-forge jpeg 9b 0 conda-forge jsonschema 2.5.1 py35_0 conda-forge jupyter_client 4.4.0 py35_0 conda-forge jupyter_console 5.0.0 py35_0 conda-forge jupyter_core 4.2.1 py35_0 conda-forge Keras 2.0.0 kur 0.3.0 libastra 1.8 0 astra-toolbox libffi 3.2.1 3 conda-forge libgcc 5.2.0 0 libgfortran 3.0.0 1 libiconv 1.14 4 conda-forge libpng 1.6.28 0 conda-forge libsodium 1.0.10 0 conda-forge libtiff 4.0.6 7 conda-forge libxcb 1.12 0 conda-forge libxml2 2.9.4 3 conda-forge markupsafe 0.23 py35_1 conda-forge matplotlib 2.0.0 np111py35_1 conda-forge mistune 0.7.3 py35_0 conda-forge mkl 2017.0.1 0 nbconvert 5.1.1 py35_0 conda-forge nbformat 4.2.0 py35_0 conda-forge ncurses 5.9 10 conda-forge nomkl 1.0 0 notebook 4.2.3 py35_0 conda-forge numpy 1.12.0 numpy 1.11.3 py35_blas_openblas_200 [blas_openblas] conda-forge odl 0.5.3 py35_0 odlgroup openblas 0.2.19 0 conda-forge openssl 1.0.2h 3 conda-forge packaging 16.8 pandas 0.19.2 np111py35_1 conda-forge pandoc 1.19.1 0 conda-forge pandocfilters 1.4.1 py35_0 conda-forge pango 1.40.3 0 conda-forge pcre 8.39 0 conda-forge pexpect 4.2.1 py35_0 conda-forge pickleshare 0.7.3 py35_0 conda-forge pillow 4.0.0 py35_0 conda-forge pip 9.0.1 py35_0 conda-forge pixman 0.34.0 0 conda-forge prompt_toolkit 1.0.9 py35_0 conda-forge protobuf 3.1.0.post1 ptyprocess 0.5.1 py35_0 conda-forge py 1.4.31 py35_0 conda-forge pydicom 0.9.9 pydub 0.18.0 pygments 2.2.0 py35_0 conda-forge pymongo 3.2.2 py35_0 conda-forge pyparsing 2.1.10 pyparsing 2.1.10 py35_0 conda-forge pyqt 4.11.4 py35_2 conda-forge pytest 3.0.6 py35_0 conda-forge python 3.5.3 0 conda-forge python-dateutil 2.6.0 py35_0 conda-forge python-magic 0.4.12 python-speech-features 0.5 pytz 2016.10 py35_0 conda-forge PyYAML 3.12 pyzmq 16.0.2 py35_0 conda-forge qt 4.8.7 3 conda-forge qtconsole 4.2.1 py35_0 conda-forge readline 6.2 0 conda-forge scipy 0.18.1 np111py35_blas_openblas_201 [blas_openblas] conda-forge setuptools 33.1.0 py35_0 conda-forge setuptools 34.0.2 simplegeneric 0.8.1 py35_0 conda-forge sip 4.18 py35_1 conda-forge six 1.10.0 py35_1 conda-forge six 1.10.0 sqlite 3.13.0 1 conda-forge tensorflow 0.12.1 terminado 0.6 py35_0 conda-forge testpath 0.3 py35_0 conda-forge Theano 0.8.2 tk 8.5.19 1 conda-forge tornado 4.4.2 py35_0 conda-forge tqdm 4.11.2 traitlets 4.3.0 py35_0 conda-forge wcwidth 0.1.7 py35_0 conda-forge werkzeug 0.11.10 py35_0 conda-forge Werkzeug 0.11.15 wheel 0.29.0 py35_0 conda-forge wheel 0.29.0 widgetsnbextension 1.2.6 xz 5.2.2 0 conda-forge zeromq 4.1.5 0 conda-forge zlib 1.2.11 0 conda-forge

josh-gree commented 7 years ago

Any help would be much appreciated!

Josh

ajsyp commented 7 years ago

Hey Josh! This is actually very likely because of an upstream dependency change. Yesterday, Keras 2.0 was released, but it breaks backwards compatibility with Keras 1.x, which is what Kur uses for the Theano and TensorFlow backends. I am literally in the process of running the final unit tests which add Keras 2.0 support to Kur. So your options are:

  1. Wait another 30 minutes, update Kur using the latest version from GitHub, and everything should work :)
  2. Switch to the PyTorch backend instead. Add this to your Kurfiles (e.g., mnist.yml)
    settings:
    backend: pytorch

    Note that the PyTorch backend does not currently support the CTC loss function, so everything should work except for the speech recognition example.

josh-gree commented 7 years ago

Thanks very much!

Josh

On 15 Mar 2017, at 14:47, Adam Sypniewski notifications@github.com wrote:

Hey Josh! This is actually very likely because of an upstream dependency change. Yesterday, Keras 2.0 was released, but it breaks backwards compatibility with Keras 1.x, which is what Kur uses for the Theano and TensorFlow backends. I am literally in the process of running the final unit tests which add Keras 2.0 support to Kur. So your options are:

Wait another 30 minutes, update Kur using the latest version from GitHub, and everything should work :) Switch to the PyTorch backend instead. Add this to your Kurfiles (e.g., mnist.yml) settings: backend: pytorch Note that the PyTorch backend does not currently support the CTC loss function, so everything should work except for the speech recognition example.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/deepgram/kur/issues/37#issuecomment-286764708, or mute the thread https://github.com/notifications/unsubscribe-auth/AIb9S0X1bTGAcyebonm6m5Azxg9Atoo9ks5rl_oUgaJpZM4MeCV4.

ajsyp commented 7 years ago

There we go. You can grab the newest code from GitHub now. This Keras 2.0 issue has been pretty severe, though, so I also released a v0.4.0rc0 package to PyPI. The full-fledged v0.4.0 is due at the end of the month. If you stil have problems, let me know.