Tag Archives: Python ImportError

How to Solve Python Importerror: DLL load failed: unable to find the specified program using tensorflow

preface
There are various problems encountered during the use of TensorFlow. It is helpful to write them down for review and future learning
Problem description
When TensorFlow is installed in Anaconda, the following problem is encountered:

>>> import tensorflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Anaconda\envs\dl\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "D:\Anaconda\envs\dl\lib\site-packages\tensorflow\python\__init__.py", line 59, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "D:\Anaconda\envs\dl\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
  File "D:\Anaconda\envs\dl\lib\site-packages\google\protobuf\descriptor.py", line 47, in <module>
    from google.protobuf.pyext import _message
ImportError: DLL load failed: The specified program could not be found.

The solution
Protobuf was upgraded yesterday when Object-Detection was installed, so if you call back the version of Protobuf, you should be fine.

pip install protobuf==3.6.0

Python Importerror: DLL load failed: the page file is too small to complete the operation.

Python code training neural network: “Imerror: DLL load failed: page file is too small to complete operation.”
This problem can arise in two ways.
(1) not only in running a project to another project a python program is running, turn off it.
② The Windows operating system does not support Python’s multi-process operation. The place where the neural network uses multiple processes is on the data set load, so set the num_workers parameter in the DataLoader to 0.

    train_loader = torch.utils.data.DataLoader(
        train_dataset,
        batch_size=16,
        shuffle=True,
        num_workers=0,  # SET 0
    )