ImportError: DLL load failed: The specified procedure could not be found.
luharinos opened this issue · 4 comments
I got the following error while I tried executing the repo:
Traceback (most recent call last):
File "run.py", line 7, in <module>
from snake.game import Game, GameConf, GameMode
File "G:\AI IA 2\AiSnake\Snake\snake\game.py", line 12, in <module>
from snake.solver import DQNSolver, GreedySolver, HamiltonSolver
File "G:\AI IA 2\AiSnake\Snake\snake\solver\__init__.py", line 9, in <module>
from snake.solver.dqn import DQNSolver
File "G:\AI IA 2\AiSnake\Snake\snake\solver\dqn\__init__.py", line 11, in <module>
import tensorflow as tf
File "G:\AI IA 2\AiSnake\lib\site-packages\tensorflow\__init__.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "G:\AI IA 2\AiSnake\lib\site-packages\tensorflow\python\__init__.py", line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "G:\AI IA 2\AiSnake\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
from google.protobuf import descriptor as _descriptor
File "G:\AI IA 2\AiSnake\lib\site-packages\google\protobuf\descriptor.py", line 47, in <module>
from google.protobuf.pyext import _message
ImportError: DLL load failed: The specified procedure could not be found.
Kindly help at the earliest possible.
Have you run the following command?
$ pip3 install -r requirements.txt
Yes, I created a python3.6
virtual environment, installed requirements.txt
via pip
, which showed an error:
tensorflow 1.11.0 has requirement setuptools<=39.1.0, but you'll have setuptools 40.4.3 which is
incompatible.
Later, I installed tensorflow
separately using;
$ pip install tensorflow
which uninstalled setuptools-40.4.3
and installed setuptools-39.1.0
When I tried checking the version of the tensorflow
using:
$ python -c 'import tensorflow as tf; print(tf.__version__)'
it again shows the above mentioned error.
I think the problem is related to protobuf. I found the same issue here.
FYI, you can try reverting protobuf to version 3.6.0:
Running Windows 7, python 3.6.0 (Anaconda 4.3.0). I can confirm this same error message with protobuf 3.6.1 (protobuf 3.6.1 installed as part of an upgrade to tensorflow-gpu 1.10.0, and the error prevented tensorflow from successfully importing).
I can also confirm that reverting to protobuf 3.6.0 allowed me to successfully import tensorflow (for those encountering the error this way and looking for a temporary solution).
Yes, the earlier version of protobuf
was 3.6.1
, which I downgraded to 3.6.0
, using:
$ pip uninstall protobuf
$ pip install protobuf==3.6.0
The game, now, works smooth and fine.
Thanks for your quick and kind help!