I'm doing my code exactly the same with https://www.youtube.com/watch?v=y1ZrOs9s2QA&t=4124s in minute 1:11:09.
I write this code :
pickle_in = open("venv/model_trained.p","rb")
model = pickle.load(pickle_in)
It showed an error like this when I tried to run it.
Error that I got after running the code
Is someone having the same issue as me?
Thank you.
Best Regards,
Bhetrand
Never mind, I solved it, the problem is on the python version that doesn't support TensorFlow version 2.0.0, I guess pickle can work well in TensorFlow 2.0.0 and we need the python version 3.5- 3.7 to run tensor flow 2.0.0.
Related
I tried running this command but i get erros that i dont have tenserflow 2.2 or higher. But I checked and I have the correct version of tenserflow. I also did pip3 install keras command
I know for a fact that all of the code is correct because it worked for my teacher the other day and nothing has changed. I just need to run his commands but i keep running into problems
I am doing this course following everything he does in a recorded video so there must be no issue there but for some reason it just doesn't work
just install tensorflow as requested in the last line of the error message: pip install tensorflow. It is needed as backend for Keras.
Also, since keras is part of tensorflow now, I recommend to write imports as from tensorflow.keras.[submodule name] import instead of from keras.[submodule name] import
I'm a beginner.
I'm working with python - TensorFlow '2.2.0' on python IDLE.
run_opts = tf.RunOptions(report_tensor_allocations_upon_oom = True)
I got the following error while running the previous code.:
AttributeError: module 'tensorflow' has no attribute 'RunOptions'"
however, according to example 18 from this link on the official page on Tensorflow, there's no error!
what's wrong in my case? How should I resolve this issue?
This is a compatibility issue between tensorflow 1.x and tensorflow 2.x. In other words, the syntax that you wrote works fine with tensorflow 1.x. But as you mentioned, you're using tensorflow 2.2 which is incompatible.
So, you have can solve this issue by either one of the following two options:
Uninstall tensorflow 2.2 and install tensorflow 1.15 which will save you a lot of the headache knowing that the link that you've posted is using tensorflow 1.13.1 as mentioned in the README file.
Or you can use tf.compat.v1.RunOptions instead of just tf.RunOptions.
I have a problem with tesorflow session or python.
Everytime I try to print some tensor values to check the network works well,
the program stops with this error.
" Process finished with exit code -1073741819 (0xC0000005) "
I use python 3.5 and tensorflow-gpu 1.14.0 now.
I also tried a very simple code like below, the process stopped without printing any values.
I can't find out what's wrong.
Can anyone help me? Thanks.
input = tf.constant([2, 3, 4])
with tf.compat.v1.Session() as sess:
print(sess.run(input))
I also can see this comment what I've never seen before. Is this the problem?
" GPU libraries are statically linked, skip dlopen check."
I solved the problem by making a new pycharm project.
And the error about GPU,
"GPU libraries are statically linked, skip dlopen check."
→ I downgraded the tensorflow-gpu version to 1.13.1 because 1.14.0 may not compatiable with CUDA 10.0.
I was trying to save a trained model using my_model.save('path/file.h5'). However, I obtained an error message: KeyError: 'predictions_ib-0'
I did some research but could not find a solution. I put my code on Github and the link is down below. The error shows up at In[39]
https://github.com/xizhenke/test2/blob/master/demo-Copy1.ipynb
Please give me some suggestions, thank you in advance!
I did more research and found it seems to be an "on-going" bug of the latest Keras (2.2.0+). So what I ended up doing was down-grading Keras to 2.1.6. And it works like a charm. I hope this could help people who have a similar issue.
Make sure you use pip or conda to down-grade. Or you may run into a package dependency issue.
Using Python 2.7 (miniconda) and trying to run below example, but it is said Unresolved reference to example_parser_configuration_pb2, does anyone have any solutions?
BTW, my machine is configured with tensorflow and I can run some tensorflow examples, so tensorflow basic configuration should be ok.
from tensorflow.core.example import example_parser_configuration_pb2
https://github.com/tensorflow/tensorflow/blob/754048a0453a04a761e112ae5d99c149eb9910dd/tensorflow/python/util/example_parser_configuration_test.py#L70
regards,
Lin