• 1400/01/11

خطا در استفاده از tenserflow :

در هنگام imprrt  این خطا ظاهر میشه. 

بنده ویندوز 10 استفاده میکنن

متن خطا:

 

ImportError                               Traceback (most recent call last)

~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>

    63   try:

---> 64     from tensorflow.python._pywrap_tensorflow_internal import *

    65   # This try catch logic is because there is no bazel equivalent for py_extension.

ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)

<ipython-input-4-f83c6d50081b> in <module>

----> 1 import tensorflow as tf

     2 print(tf.__version__)

~\anaconda3\lib\site-packages\tensorflow\__init__.py in <module>

    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  

~\anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>

    37 # go/tf-wildcard-import

    38 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top

---> 39 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow

    40  

    41 from tensorflow.python.eager import context

~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>

    81 for some common reasons and solutions.  Include the entire stack trace

    82 above this error message when asking for help.""" % traceback.format_exc()

---> 83   raise ImportError(msg)

    84  

    85 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):

 File "C:\Users\Hami\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>

   from tensorflow.python._pywrap_tensorflow_internal import *

ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.

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.

 

  • 1400/01/12
  • ساعت 00:27

سلام

از دستور زیر در cmd استفاده کنید تا با استفاده از آنکاندا در یک محیط جداگانه TF رو نصب کنید.

احتمالا مشکلتون حل میشه.

conda create --name tf python=3.8 tensorflow 
conda activate tf

 راه دیگه میتونه انتخاب یک نسخه دیگه از tensorflow باشه.

pip install tensorflow==2.0


  • 1400/01/14
  • ساعت 10:47

سلام با روش های فوق هم مشکل حل نشد.

اما با نصب  “Microsoft C++ Redistributable for Visual Studio 2015, 2017 and 2019 مشکل برطرف شد.

You may install these DLLs by downloading “Microsoft C++ Redistributable for Visual Studio 2015, 2017 and 2019” for your platform from this URL: https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads 

 

سپاس


logo-enamadlogo-samandehi