Python Forum
Newbie at using python and tensorflow getting error when running simple code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newbie at using python and tensorflow getting error when running simple code
#1
Hi, I am trying to use tensorflow but I could not run the code at all. I recieved a very long chain of error, which I am unsure if it is due to my installation problem.
My code is:
import tensorflow as tf

node1 = tf.constant(3.0, tf.float32)
node2 = tf.constant(4.0)
And the error that came out is:
Error:
================ RESTART: C:/Users/user/Desktop/Tensorflow.py ================ Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:/Users/user/Desktop/Tensorflow.py", line 1, in <module> import tensorflow as tf File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 22, in <module> from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module> from tensorflow.python import pywrap_tensorflow File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found. Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  issue displaying summary of whole keras CNN model on TensorFlow with python Afrodizzyjack 0 1,621 Oct-27-2021, 04:07 PM
Last Post: Afrodizzyjack
  Error in running the Elliott Fitting function shashisourabh 9 5,156 Nov-19-2020, 06:54 PM
Last Post: osvan
  Trying to get a "simple" code to work, re: 3.5 vs 3.8 vs Not using Linux Evalias 3 2,409 Aug-08-2020, 04:33 AM
Last Post: scidam
  How to install tensorflow? It shows as error jaroslavtavgen 1 1,926 Apr-26-2020, 10:09 PM
Last Post: Larz60+
  TensorFlow CNN get error - DataType uint8 not in list vokoyo 3 6,385 Nov-09-2019, 04:03 AM
Last Post: xuanloc97
  TensorFlow get error - array with more than one element is ambiguous vokoyo 3 5,503 Nov-07-2019, 01:12 PM
Last Post: ThomasL
  Simple numpy reshape error wih contour3D AdeIsHere 0 2,150 Sep-17-2019, 12:01 PM
Last Post: AdeIsHere
  panda, excel - script pauses and doesn't continue running, no error message william 1 2,653 Nov-24-2018, 01:24 AM
Last Post: ichabod801
  Python import tensorflow error owenhe 7 6,995 Jun-23-2018, 12:41 PM
Last Post: gontajones
  how to reduce running time of the code dilmailid 6 3,944 May-18-2018, 02:49 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020