소개
게시글
질문&답변
TypeError: in user code: TypeError: Can not convert a NoneType into a Tensor or Operation.
성의있는 답변 고맙습니다. 되도록 혼자 해결하려고 노력하는데 안되는 군요. 선생님의 말씀대로 시도했으나 다음과 같은 결과가 나왔습니다. 물론 anaconda3를 삭제했고, pip 이나 conda를 이용해서 tensorflow를 모두 삭제하고 python 3.7.7 tensorflow 2.2.0(cpu) numpy 1.19.3을 새로 깔았습니다. 이전에 깐 tensorflow를 전부 삭제 한다고 했는데 덜 삭제 되었나 싶기도 하고 ... 매번 죄송합니다. import tensorflow as tf import matplotlib import gym import numpy as np print(tf.__version__) ImportError Traceback (most recent call last) c:\python377\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in 57 ---> 58 from tensorflow.python.pywrap_tensorflow_internal import * 59 c:\python377\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in 27 return _mod ---> 28 _pywrap_tensorflow_internal = swig_import_helper() 29 del swig_import_helper c:\python377\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper() 23 try: ---> 24 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) 25 finally: c:\python377\lib\imp.py in load_module(name, file, filename, details) 241 else: --> 242 return load_dynamic(name, filename, file) 243 elif type_ == PKG_DIRECTORY: c:\python377\lib\imp.py in load_dynamic(name, path, file) 341 name=name, loader=loader, origin=path) --> 342 return _load(spec) 343 ImportError: DLL load failed: DLL 초기화 루틴을 실행할 수 없습니다. During handling of the above exception, another exception occurred: ImportError Traceback (most recent call last) C:\Users\ADMINI~1\AppData\Local\Temp/ipykernel_9004/353091140.py in ----> 1 import tensorflow as tf 2 import matplotlib 3 import gym 4 import numpy as np 5 print(tf.__version__) c:\python377\lib\site-packages\tensorflow\__init__.py in 39 import sys as _sys 40 ---> 41 from tensorflow.python.tools import module_util as _module_util 42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader 43 c:\python377\lib\site-packages\tensorflow\python\__init__.py in 48 import numpy as np 49 ---> 50 from tensorflow.python import pywrap_tensorflow 51 52 # Protocol buffers c:\python377\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in 67 for some common reasons and solutions. Include the entire stack trace 68 above this error message when asking for help.""" % traceback.format_exc() ---> 69 raise ImportError(msg) 70 71 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long ImportError: Traceback (most recent call last): File "c:\python377\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "c:\python377\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "c:\python377\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:\python377\lib\imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "c:\python377\lib\imp.py", line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: DLL 초기화 루틴을 실행할 수 없습니다. Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.
- 0
- 5
- 842
질문&답변
TypeError: in user code: TypeError: Can not convert a NoneType into a Tensor or Operation.
어떻게 해야 하나요? 아! 참, 이런 환경이 되니까 jupyter notebook도 실행이 안되고 다음과 같은 error가 나더라구요. (base) C:\Users\Administrator>jupyter notebook Traceback (most recent call last): File "C:\ProgramData\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in from notebook.notebookapp import main File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 78, in from .services.kernels.kernelmanager import MappingKernelManager, AsyncMappingKernelManager File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 18, in from jupyter_client.session import Session File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\session.py", line 41, in from jupyter_client.jsonutil import extract_dates, squash_dates, date_default File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\jsonutil.py", line 11, in from dateutil.tz import tzlocal ImportError: cannot import name 'tzlocal' from 'dateutil.tz' (C:\ProgramData\Anaconda3\lib\site-packages\dateutil\tz\__init__.py)
- 0
- 5
- 842