Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in run with tensorflow #2

Open
AIAdventures opened this issue Apr 26, 2017 · 2 comments
Open

Error in run with tensorflow #2

AIAdventures opened this issue Apr 26, 2017 · 2 comments

Comments

@AIAdventures
Copy link

Hi, was trying to test your code.

i was getting errors though.

andrewcz@andrewcz-PORTEGE-Z30t-B ~/Eigenvalue-Decay-Regularizer-for-Keras $ python example.py
Using TensorFlow backend.
60000 train samples
10000 test samples
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Traceback (most recent call last):
File "example.py", line 64, in
metrics=['accuracy'])
File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/keras/models.py", line 553, in compile
**kwargs)
File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/keras/engine/training.py", line 641, in compile
total_loss = r(total_loss)
File "/home/andrewcz/Eigenvalue-Decay-Regularizer-for-Keras/EigenvalueDecay.py", line 57, in call
domin_eigenvect = K.dot(WW, o)
File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 340, in dot
if ndim(x) is not None and (ndim(x) > 2 or ndim(y) > 2):
File "/home/andrewcz/miniconda3/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 220, in ndim
dims = x.get_shape()._dims
AttributeError: 'numpy.ndarray' object has no attribute 'get_shape'

help please.
Many thanks,
Andrew

@oswaldoludwig
Copy link
Owner

oswaldoludwig commented Apr 26, 2017 via email

@avinashkd44
Copy link

pip install git+git://github.com/avinashkd44/keras.git --upgrade # You will get here eigenvaluedecay regularizer for tensorflow backend.

Hi Andrew and Oswaldo
I have tested and modified your file and now its working for Tensor flow for mine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants