I am trying to get a github repository to work on my pc. This repository is based on tensorflow-gpu. Currently, when I try to run the code, I get the following error:
Traceback (most recent call last):
File "D:/audio/deep-voice-conversion-master/deep-voice-conversion-master/convert.py", line 9, in <module>
from models import Net2
File "D:\audio\deep-voice-conversion-master\deep-voice-conversion-master\models.py", line 4, in <module>
import tensorflow as tf
File "D:\audio\deep-voice-conversion-master\deep-voice-conversion-master\venv\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "D:\audio\deep-voice-conversion-master\deep-voice-conversion-master\venv\lib\site-packages\tensorflow\python\__init__.py", line 59, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "D:\audio\deep-voice-conversion-master\deep-voice-conversion-master\venv\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
from google.protobuf import descriptor as _descriptor
File "D:\audio\deep-voice-conversion-master\deep-voice-conversion-master\venv\lib\site-packages\google\protoWbuf\descriptor.py", line 47, in <module>
from google.protobuf.pyext import _message
ImportError: DLL load failed: the specified module could not be found.
I am using pycharm on windows 10, with python 3.6.
I tried to follow these steps, but it seems outdated and I did not get it to work. I also prefer not to use anaconda, as this is a huge package and I only want to get this repository to work. So far, I have done the following:
I have installed all required packages (including the tensorflow and tensorflow-gpu packages) via pip.
I also downloaded CUDA 9.0 and cuDNN.
I have copied the files from cuDNN's bin, include and lib folders into the corresponding folders from CUDA.
I added the path to the cuda folder to the environment PATH from windows
I added the CUDA and cuDNN folder paths to the Content root folders of the project structure in pycharm (probably not helpful but someone somewhere suggested it)
I am new to tensorflow and I have no Idea what I have to do next. Any help will be appreciated.
protobuf seems to be a conda package. Try installing it with
conda install protobuf
Or
pip install protobuf
Related
I have installed the correct version of CuPy with pip install cupy-cuda117 on pyCharms as my CUDA is version 11.7. My Python version is 3.8. I also have the environment variables set but I am still receiving this message:
Traceback (most recent call last):
File "C:\Users\Dominic\PycharmProjects\Project_Trading\venv\lib\site-packages\cupy\__init__.py", line 18, in <module>
from cupy import _core # NOQA
File "C:\Users\Dominic\PycharmProjects\Project_Trading\venv\lib\site-packages\cupy\_core\__init__.py", line 1, in <module>
from cupy._core import core # NOQA
File "cupy\_core\core.pyx", line 1, in init cupy._core.core
File "C:\Users\Dominic\PycharmProjects\Project_Trading\venv\lib\site-packages\cupy\cuda\__init__.py", line 8, in <module>
from cupy.cuda import compiler # NOQA
File "C:\Users\Dominic\PycharmProjects\Project_Trading\venv\lib\site-packages\cupy\cuda\compiler.py", line 13, in <module>
from cupy.cuda import device
File "cupy\cuda\device.pyx", line 1, in init cupy.cuda.device
ImportError: DLL load failed while importing runtime: The specified module could not be found.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:/Users/Dominic/PycharmProjects/Project_Trading/regression_to_classification.py", line 77, in <module>
import cupy
File "C:\Users\Dominic\PycharmProjects\Project_Trading\venv\lib\site-packages\cupy\__init__.py", line 20, in <module>
raise ImportError(f'''
ImportError:
================================================================
Failed to import CuPy.
If you installed CuPy via wheels (cupy-cudaXXX or cupy-rocm-X-X), make sure that the package matches with the version of CUDA or ROCm installed.
On Linux, you may need to set LD_LIBRARY_PATH environment variable depending on how you installed CUDA/ROCm.
On Windows, try setting CUDA_PATH environment variable.
Check the Installation Guide for details:
https://docs.cupy.dev/en/latest/install.html
Original error:
ImportError: DLL load failed while importing runtime: The specified module could not be found.
================================================================
Process finished with exit code 1
Here is some additional info:
I ran into something similar when trying to install cupy recently. These are the steps that ultimately resulted in the import error:
Try to pip install cupy.
Realize that this is taking too long and/or requires a compiler etc.
Stop the install/build.
Install one of the prebuilt wheels (e.g. pip install cupy-cuda11x).
Notice that the cupy package is somehow installed (probably a remnant from the first stage).
pip uninstall cupy to get rid of the cupy library which shouldn't be there. << This is the stage that causes the problem!
The last step above breaks whichever mappings the wheel installer creates that allow one to import cupy despite installing a package called e.g. cupy-cuda11x.
The solution that worked for me was to remove all cupy* packages and install only the wheel distribution. In the case shown in the question, reinstalling cupy-cuda11x should do the trick.
I am going mad for installing and import tensorflow for 6 weeks. I did everything; I installed it from spyder, Conda prompt and with different commands like pip install tensorflow and conda install tensorflow. my python version is 3.7 and after install when I want to import tensorflow in spyder I get this message:
import tensorflow
Traceback (most recent call last):
File "<ipython-input-4-d6579f534729>", line 1, in <module>
import tensorflow
File "C:\Users\sally\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 27, in <module>
from tensorflow._api.v2 import audio
File "C:\Users\sally\Anaconda3\lib\site-packages\tensorflow\_api\v2\audio\__init__.py", line 8, in <module>
from tensorflow.python.ops.gen_audio_ops import decode_wav
File "C:\Users\sally\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "C:\Users\sally\Anaconda3\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 9, in <module>
from google.protobuf import symbol_database as _symbol_database
File "C:\Users\sally\Anaconda3\lib\site-packages\google\protobuf\symbol_database.py", line 184, in <module>
_DEFAULT = SymbolDatabase(pool=descriptor_pool.Default())
AttributeError: module 'google.protobuf.descriptor_pool' has no attribute 'Default
This is a very common issue. I have been there.
First: provide the following information:
- what operating system?
- do you want to run on cpu or gpu?
- if gpu, what gpu do you have?
- are your drivers up to date?
- Are your trying to run tensorflow though an IDE like Pycharm, is it more like Jupyter notebook stuff, or just cmd.
Second: There are some link that might be usefull. Here they are.
https://www.tensorflow.org/install/pip
https://www.tensorflow.org/install/gpu#software_requirements
There is a video that helped me, it might help you as well. With tensorflow it is really important to follow the instructions precisely, not missing any steps, and very important, not assuming that installing something with a higher version is no issue. If it says install 'whatever program'.version.1.1.x you can not install 'whatever program'.version.1.1.y
https://www.youtube.com/watch?v=qrkEYf-YDyI&t=1575s
I have a project which I am packaging with cx_freeze. When I try to run the resulting exe I get an ImportError: DLL load failed: The specified module could not be found.
Here is my setup.py:
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(build_exe='liquidation', packages=['scipy', 'numpy'], excludes=['scipy.spatial.cKDTree'],
includes=['scipy', 'numpy', 'numpy.core._methods', 'scipy.sparse.csgraph._validation',
'numpy.lib.format', 'numpy.linalg._umath_linalg', 'scipy.sparse._csparsetools',
'scipy.sparse.linalg.isolve._iterative', 'scipy.sparse.linalg.eigen.arpack._arpack',
'scipy.special._ufuncs_cxx', 'scipy.special.specfun', 'scipy.integrate._odepack',
'scipy.integrate._quadpack', 'scipy.integrate.vode', 'scipy.integrate._dop',
'scipy.integrate.lsoda', 'scipy.optimize._minpack', 'scipy.optimize._zeros',
'scipy.spatial', 'scipy.spatial.ckdtree', 'scipy.spatial.kdtree',
'scipy._distributor_init', 'numpy.core._multiarray_umath'])
base = 'Console'
executables = [
Executable('liquidation.py', base=base, targetName='liquidation.exe')
]
setup(name='liquidation',
version='2.0',
description='Program to run and test Liquidation algorithms',
options=dict(build_exe=buildOptions),
executables=executables)
When I run python setup.py build_exe it seems to complete successfully, but when I run the exe I get the following output:
Traceback (most recent call last):
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\numpy\core\__init__.py", line 24, in <module>
from . import multiarray
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\numpy\core\multiarray.py", line 14, in <module>
from . import overrides
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\numpy\core\overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 40, in run
module.run()
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\cx_Freeze\initscripts\Console.py", line 37, in run
exec(code, {'__name__': '__main__'})
File "liquidation.py", line 64, in <module>
from io_tools.stock_wrapper import StockWrapper
File "C:\Users\tamar\PycharmProjects\liquidation\io_tools\stock_wrapper.py", line 4, in <module>
from io_tools.io_helper import *
File "C:\Users\tamar\PycharmProjects\liquidation\io_tools\io_helper.py", line 7, in <module>
from numpy import float_
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import core
File "C:\Users\tamar\PycharmProjects\liquidation\venv\lib\site-packages\numpy\core\__init__.py", line 54, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
1. Check that you expected to use Python3.7 from "C:\Users\tamar\PycharmProjects\liquidation\liquidation\liquidation.exe",
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy version "1.18.3" you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: DLL load failed: The specified module could not be found.
I understand that I need to point cx_freeze to the missing DLL's (either by adding them to buildOptions.include_files or by actually copying the DLL's to the build folder) but I am at a loss as to how to know which DLL's I am missing. numpy.core._multiarray_umath is in the build folder so I don't know what it could be.
I believe I am using the latest versions of numpy (1.18.3), scipy (1.4.1) and cx-freeze (6.1). Any help would be much appreciated!
Update: I used Dependency Walker to try and see what I am missing and it listed a file by the name of LIBOPENBLAS.SVHFG5YE3RK3Z27NVFUDAPL2O3W6IMXW.GFORTRAN-WIN32.DLL which cannot be found. All of the other dependencies have been copied into the build so it makes sense that this would be the missing one. Does anyone know where I can find this file?
I am running Glumpy on python 3.7.2 and windows 10. I keep getting this error EVEN AFTER installing through pip.
Traceback (most recent call last):
File "C:\Users\algeb\Downloads\Animoji-Animate-master\animate.py", line 3, in <module>
from glumpy import app, gloo, gl
File "C:\Users\algeb\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glumpy\__init__.py", line 7, in <module>
from . import app
File "C:\Users\algeb\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glumpy\app\__init__.py", line 16, in <module>
from glumpy.ext.inputhook import inputhook_manager, stdin_ready
File "C:\Users\algeb\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glumpy\ext\__init__.py", line 6, in <module>
from . import freetype
File "C:\Users\algeb\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glumpy\ext\freetype\__init__.py", line 49, in <module>
raise RuntimeError('Freetype library not found')
RuntimeError: Freetype library not found
Per discussion in the comments above, the problem seems to have been that Glumpy requires the freetype package, which requires the FreeType library to be installed. You can download Windows binaries for FreeType, e.g., here. Make sure to download the .dll for the correct platform (in your case, that would seem to be 64-Bit now). Once downloaded, place the .dll somewhere on your machine and add the path to the directory where it's located to the PATH environment variable. Then the freetype package should be able to find it. More detailed installation instructions can be found in the freetype package Readme.
For me it helped to install the Microsoft C++ Redistributable from https://visualstudio.microsoft.com/en/downloads/
I usually code in Matlab but I found a nice piece of PYTHON code that I would like to use. However having downloaded the package it is proving difficult to run. I'm getting the following error:
Traceback (most recent call last):
File "C:\launch.py", line 29, in <module>
from src.smcsquare import SMCsquare
File "C:\src\smcsquare.py", line 32, in <module>
from scipy.stats import norm
File "C:\Python34\lib\site-packages\scipy\stats\__init__.py", line 338, in <module>
from .stats import *
File "C:\Python34\lib\site-packages\scipy\stats\stats.py", line 184, in <module>
import scipy.special as special
File "C:\Python34\lib\site-packages\scipy\special\__init__.py", line 586, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
The _ufuncs.pyd is there in the C:\Python34\lib\site-packages\scipy\special\ directory. I tried adding this to my PYTHONPATH but it made no difference. I have also tried so dll fixers but these have not helped.
Has anyone encountered this and did you find a solution?
As other have said, make sure your .whl file matches the version and 32/64bit of the python distribution you're using.
Next, the problem I was having was I forgot to download and install the extra "numpy+mkl" package per the instruction: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
So for me it was numpy-1.11.0+mkl-cp35-cp35m-win_amd64.whl, which I downloaded and then:
python -m pip install numpy-1.11.0+mkl-cp35-cp35m-win_amd64.whl
I had already installed the regular numpy package via pip, but I just installed this one over it and everything started working and has been fine so far.