Я пытаюсь использовать нейронную сеть, но у меня проблема с импортом Tensorflow. Раньше он хорошо работал несколько месяцев go. Я думаю, что пытался получить доступ к моей видеокарте, не имея ее, или, по крайней мере, без доступа к ней. На данный момент, вот ошибка:
>>> import tensorflow
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\self_check.py in preload_check()
74 try:
---> 75 ctypes.WinDLL(build_info.cudart_dll_name)
76 except OSError:
C:\ProgramData\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
355 if handle is None:
--> 356 self._handle = _dlopen(self._name, mode)
357 else:
OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-607-ab280936f4d9> in <module>
----> 1 import tensorflow as tf
2
3 def focal_loss(gamma=2., alpha=4.):
4
5 gamma = float(gamma)
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\__init__.py in <module>
26
27 # pylint: disable=g-bad-import-order
---> 28 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
29 from tensorflow.python.tools import module_util as _module_util
30
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\__init__.py in <module>
47 import numpy as np
48
---> 49 from tensorflow.python import pywrap_tensorflow
50
51 # Protocol buffers
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
28 # Perform pre-load sanity checks in order to produce a more actionable error
29 # than we get from an error during SWIG import.
---> 30 self_check.preload_check()
31
32 # pylint: disable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\self_check.py in preload_check()
80 "environment variable. Download and install CUDA %s from "
81 "this URL: https://developer.nvidia.com/cuda-90-download-archive"
---> 82 % (build_info.cudart_dll_name, build_info.cuda_version_number))
83
84 if hasattr(build_info, "cudnn_dll_name") and hasattr(
ImportError: Could not find 'cudart64_100.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 10.0 from this URL: https://developer.nvidia.com/cuda-90-download-archive
Я нахожусь в процессе удаления, чтобы вернуть версию, которая подходит.
тензор потока == 1.15
Там та же проблема и больше ошибок:
ROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
File "C:\Users\antoi\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3319, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-609-ab280936f4d9>", line 1, in <module>
import tensorflow as tf
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 99, in <module>
from tensorflow_core import *
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Users\antoi\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\self_check.py", line 82, in preload_check
ImportError: Could not find 'cudart64_100.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 10.0 from this URL: https://developer.nvidia.com/cuda-90-download-archive
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2034, in showtraceback
stb = value._render_traceback_()
AttributeError: 'ImportError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\antoi\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 1151, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 319, in wrapped
return f(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 353, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1502, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1460, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), '__loader__', None) is not None:
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 733, in getmodule
if ismodule(module) and hasattr(module, '__file__'):
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Users\antoi\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\self_check.py", line 82, in preload_check
ImportError: Could not find 'cudart64_100.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 10.0 from this URL: https://developer.nvidia.com/cuda-90-download-archive
Traceback (most recent call last):
File "C:\Users\antoi\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3319, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-609-ab280936f4d9>", line 1, in <module>
import tensorflow as tf
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 99, in <module>
from tensorflow_core import *
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Users\antoi\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\self_check.py", line 82, in preload_check
ImportError: Could not find 'cudart64_100.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 10.0 from this URL: https://developer.nvidia.com/cuda-90-download-archive
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2034, in showtraceback
stb = value._render_traceback_()
AttributeError: 'ImportError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3242, in run_ast_nodes
if (await self.run_code(code, result, async_=asy)):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3336, in run_code
self.showtraceback(running_compiled_code=True)
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2037, in showtraceback
value, tb, tb_offset=tb_offset)
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 1418, in structured_traceback
self, etype, value, tb, tb_offset, number_of_lines_of_context)
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 1318, in structured_traceback
self, etype, value, tb, tb_offset, number_of_lines_of_context
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 1186, in structured_traceback
formatted_exceptions += self.prepare_chained_exception_message(evalue.__cause__)
TypeError: can only concatenate str (not "list") to str
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2034, in showtraceback
stb = value._render_traceback_()
AttributeError: 'TypeError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\antoi\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 1151, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 319, in wrapped
return f(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 353, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1502, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1460, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), '__loader__', None) is not None:
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 733, in getmodule
if ismodule(module) and hasattr(module, '__file__'):
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Users\antoi\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\self_check.py", line 82, in preload_check
ImportError: Could not find 'cudart64_100.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 10.0 from this URL: https://developer.nvidia.com/cuda-90-download-archive
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\self_check.py in preload_check()
C:\ProgramData\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
355 if handle is None:
--> 356 self._handle = _dlopen(self._name, mode)
357 else:
OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code)
2033 # in the engines. This should return a list of strings.
-> 2034 stb = value._render_traceback_()
2035 except Exception:
AttributeError: 'ImportError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py in run_code(self, code_obj, result, async_)
3334 if result is not None:
3335 result.error_in_exec = sys.exc_info()[1]
-> 3336 self.showtraceback(running_compiled_code=True)
3337 else:
3338 outflag = False
C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code)
2035 except Exception:
2036 stb = self.InteractiveTB.structured_traceback(etype,
-> 2037 value, tb, tb_offset=tb_offset)
2038
2039 self._showtraceback(etype, value, stb)
C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py in structured_traceback(self, etype, value, tb, tb_offset, number_of_lines_of_context)
1416 self.tb = tb
1417 return FormattedTB.structured_traceback(
-> 1418 self, etype, value, tb, tb_offset, number_of_lines_of_context)
1419
1420
C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py in structured_traceback(self, etype, value, tb, tb_offset, number_of_lines_of_context)
1316 # Verbose modes need a full traceback
1317 return VerboseTB.structured_traceback(
-> 1318 self, etype, value, tb, tb_offset, number_of_lines_of_context
1319 )
1320 elif mode == 'Minimal':
C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py in structured_traceback(self, etype, evalue, etb, tb_offset, number_of_lines_of_context)
1184 exception = self.get_parts_of_chained_exception(evalue)
1185 if exception:
-> 1186 formatted_exceptions += self.prepare_chained_exception_message(evalue.__cause__)
1187 etype, evalue, etb = exception
1188 else:
TypeError: can only concatenate str (not "list") to str