When using Keras, I get an error and cannot run. If i am familiar with Keras, please teach me. Thank you.Error message
I use a jupyter notebook and the following is the input code.
from keras.models import Sequential
from keras.layers import Dense
model = Sequential ()
model.add (Dense (64, activation ='relu&apos ;, input_dim = 784))
When the above code is executed, the following error message appears.
AttributeError: module'tensorflow.python.framework.ops'has no attribute'_TensorLike'
It looks like you can import Keras and tensorflow, but I get an error and can't proceed. It seems that this error appears when "input_dim = 784" is entered.Tried
After checking the error in English, there was no answer to the same question yet, and no answer answered directly that it was in Japanese.Supplemental information (FW/tool version etc.)
・ Macbook Pro 10.12.6 (Good quality second-hand goods)
・ Echo $PATH
・ .bash_profileexport PYENV_ROOT ="$HOME/.pyenv" export PATH ="$PYENV_ROOT/bin: $PATH" eval"$(pyenv init-)" export PATH ="/anaconda3/bin: $PATH"
・ Python 3.6.1
・ Tensorflow 0.10.0
・ Keras 2.2.2
Answer # 1
It is necessary to download the latest tensorflow because it cannot be used without upgrading tensorflow. But
pip3 install -U tensorflow
And type the following error:
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: u'/private/var/folders/4y/z038tqx15jvfqptw0s_tmz8w0000gp/T/pip-unpack-Sk9pwB/tensorflow-1.8.0-cp27-cp27m-macosx_10_11_86_86 ;
Consider using the --user option or check the permissions.
This is probably an error because/private/var/folders/4y/z038tqx15jvfqptw0s_tmz8w0000gp/T/pip-unpack-Sk9pwB/This directory did not exist It seems to have been.
First, create this directory yourself and access restrictions are applied.
Search for the file, download it and place it there. In that place
pip3 install -U tensorflow-1.8.0-cp27-cp27m-macosx_10_11_x86_64.whl
I was able to download it.
You can now use Keras and others that you can't use without a tensorflow upgrade.
- module import error when executing wsl python code with vscode
- python - when i try to use to_categorical in keras, i get a no attribute error
- python - how to handle exe error no module named'scipysparsecsgraph_validation' with cx_freeze
- python - modulenotfounderror: no module named error
- python - i want to process the input tag of type=date attribute with selenium
- python - i want to use the stack to reverse the strings, but an error occurs, so please give me a solution
- please tell me how to deal with range error in python list comprehension
- python - [error 5] access is denied: occurs in osmakedirs
- i'm having trouble with a python syntax error
- python - list index out of range error occurs for index 0
- python - module can't be imported even though the path should pass
- [python] an error occurred when converted to exe [tkinter/pyinstaller]
- i want to eliminate undefined variable error in python in vs code
- python - karnel error in jupyter lab and pandas is not imported
- i'm having trouble getting an error when using bind with python tkinter
- python - i'm getting an error that render_to_response cannot be imported by django
- python - i want to search for an integer by binary search, but this is an error i am a beginner
- [python] output error because the file format is not recognized when creating a graphviz file
- python - about the error "allocation of 536870912 exceeds 10% of system memory" when learning cnn
- python - understanding hidden layers and parameters of lstm
- python - please tell me the solution of yolov3 error [filenotfounderror: [errno 2] no such file or directory:'traintxt']
- python - environment preparation for using keras
- python - error converting to tpu model
- python - about keras maxpooling2d
- python - keras cannot be imported
- python - i cannot start tensorboard (i get an error, i was able to do it before)
- python - 'functional' object has no attribute'predict_classes' cannot be fixed
- python - valueerror: input 0 of layer sequential_5 is incompatible with the layer: expected ndim = 3, found ndi
- python: want to download mnist from tensorflow_datasets