0

enter image description here

enter image description here

tensorflow_installation_test.py

import tensorflow as tf
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"

print(tf.__version__)

the following is the output:

C:\Users\pc\AppData\Local\Microsoft\WindowsApps\python3.7.exe C:/Users/pc/source/repos/_by_nn/SCRIPTS/tensorflow_installation_test.py
2021-06-18 02:29:13.894907: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-06-18 02:29:13.895173: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "C:/Users/pc/source/repos/_by_nn/SCRIPTS/tensorflow_installation_test.py", line 1, in <module>
    import tensorflow as tf
  File "C:\Users\pc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\pc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\python\__init__.py", line 48, in <module>
    from tensorflow.python import keras
  File "C:\Users\pc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\python\keras\__init__.py", line 25, in <module>
    from tensorflow.python.keras import models
  File "C:\Users\pc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\python\keras\models.py", line 25, in <module>
    from tensorflow.python.keras.engine import training_v1
  File "C:\Users\pc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\python\keras\engine\training_v1.py", line 46, in <module>
    from tensorflow.python.keras.engine import training_arrays_v1
  File "C:\Users\pc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\python\keras\engine\training_arrays_v1.py", line 37, in <module>
    from scipy.sparse import issparse  # pylint: disable=g-import-not-at-top
  File "C:\Users\pc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\__init__.py", line 130, in <module>
    from . import _distributor_init
  File "C:\Users\pc\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\_distributor_init.py", line 61, in <module>
    WinDLL(os.path.abspath(filename))
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

Process finished with exit code 1

How do I fix this?

user366312
  • 16,949
  • 65
  • 235
  • 452
  • 1
    its saying it could not the load the GPU library one way is that you read this https://www.tensorflow.org/install/source_windows – MrHola21 Jun 18 '21 at 03:01
  • This link can help you https://stackoverflow.com/questions/59823283/could-not-load-dynamic-library-cudart64-101-dll-on-tensorflow-cpu-only-install – coderina Jun 18 '21 at 03:44

1 Answers1

0

So according to this link on StackOverflow, this is not a problem just for you. The real clue to your error is the WinError 126. Some causes I could find online listed here on ErrorTools. My recommendation would be to perhaps, if you are using Anaconda environments, to create a new environment and install TensorFlow there and see if it works. If it does not, perhaps there is something wrong with your DLLs.

Another option, in that case, would be to follow the stack trace that is laid out to you to debug until you reach this line: self._handle = _dlopen(self._name, mode) in __init__.py under the ctypes directory. At that point, you can examine what is the value of self._name and see if it matches any of the problems outlined on the linked StackOverflow question above.

If you are unsure where to find all of these files for future debugging on your own, I would recommend that you use Everything by VoidTools since it performs much quickers searches than File Explorer.

Mahyar Mirrashed
  • 471
  • 1
  • 3
  • 14