tensorflowをうまく起動させたいのですがうまくいきません。
どのような対処方法でimportすることができますか。
python3.8
1import tensorflow as tf 2hello = tf.constant('Hello, TensorFlow!') 3sess = tf.Session() 4print(sess.run(hello)) 5` 6OSError Traceback (most recent call last) 7~\Anaconda3\lib\site-packages\tensorflow\python\platform\self_check.py in preload_check() 8 86 try: 9---> 87 ctypes.WinDLL(build_info.cudnn_dll_name) 10 88 except OSError: 11 12~\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error) 13 347 if handle is None: 14--> 348 self._handle = _dlopen(self._name, mode) 15 349 else: 16 17OSError: [WinError 126] 指定されたモジュールが見つかりません。 18 19During handling of the above exception, another exception occurred: 20 21ImportError Traceback (most recent call last) 22<ipython-input-1-7f1ffbc4fd7f> in <module>() 23----> 1 import tensorflow as tf 24 2 hello = tf.constant('Hello, TensorFlow') 25 3 sess = tf.Session() 26 4 print(sess.run(hello)) 27 28~\Anaconda3\lib\site-packages\tensorflow\__init__.py in <module>() 29 20 30 21 # pylint: disable=g-bad-import-order 31---> 22 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import 32 23 33 24 try: 34 35~\Anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>() 36 47 import numpy as np 37 48 38---> 49 from tensorflow.python import pywrap_tensorflow 39 50 40 51 # Protocol buffers 41 42~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>() 43 28 # Perform pre-load sanity checks in order to produce a more actionable error 44 29 # than we get from an error during SWIG import. 45---> 30 self_check.preload_check() 46 31 47 32 # pylint: disable=wildcard-import,g-import-not-at-top,unused-import,line-too-long 48 49~\Anaconda3\lib\site-packages\tensorflow\python\platform\self_check.py in preload_check() 50 95 "necessary DLL by downloading cuDNN %s from this URL: " 51 96 "https://developer.nvidia.com/cudnn" 52---> 97 % (build_info.cudnn_dll_name, build_info.cudnn_version_number)) 53 98 54 99 else: 55 56ImportError: Could not find 'cudnn64_7.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Note that installing cuDNN is a separate step from installing CUDA, and this DLL is often found in a different directory from the CUDA DLLs. You may install the necessary DLL by downloading cuDNN 7 from this URL: https://developer.nvidia.com/cudnn
回答1件
あなたの回答
tips
プレビュー