Issue importing Ketos - reintall of Anaconda seemed to work!
Problem: I am encountering errors when attempting to start running code locally – this problem does not occur when I run jupyter notebooks from the terminal. I use Anaconda and have setup an environment in Conda and then used that environment in Pycharm and Spyder (along with specifying a configuration), but have also tried setting up a virtual environment with PyCharm with a python download and installing with pip. I have tried indicating python 3.6 and 3.7 in the environment creation, and then run through and install ketos after environment created. I have tried installing ketos to native folder and to the working drive (as the errors occur at import stage). Pycharm is updated and ketos and tensorflow are confirmed as installed in my environment. Below are the errors I get with both the Spyder approach and when testing with the Pycharm virtual environment that used Python 3.7 download and skilled Conda. I am using Win 10 machine and reinstalled Anaconda after running into problems initialls. I am a novice python user so any help in getting this up and running (with whatever version of setup) is appreciated!
Testing Spyder with Anaconda Navigator for environment creation: After setup and setting environment (and ketos confirmed install, I try to run this code):
import pandas as pd from ketos.data_handling import selection_table as sl import ketos.data_handling.database_interface as dbi from ketos.data_handling.parsing import load_audio_representation from ketos.audio.spectrogram import MagSpectrogram from ketos.data_handling.parsing import load_audio_representation
Python 3.7.11 (default, Jul 27 2021, 09:42:29) [MSC v.1916 64 bit (AMD64)] Type "copyright", "credits" or "license" for more information.
IPython 7.29.0 -- An enhanced Interactive Python.
runfile('C:/Users/eferg/.spyder-py3/temp.py', wdir='C:/Users/eferg/.spyder-py3')
2021-12-17 16:55:09.726288: 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-12-17 16:55:09.726374: 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.
2021-12-17 16:55:09.726288: 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-12-17 16:55:09.726374: 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.
2021-12-17 16:55:11.733104: 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-12-17 16:55:11.734239: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublas64_11.dll'; dlerror: cublas64_11.dll not found
2021-12-17 16:55:11.735728: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublasLt64_11.dll'; dlerror: cublasLt64_11.dll not found
2021-12-17 16:55:11.736798: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2021-12-17 16:55:11.737861: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found
2021-12-17 16:55:11.738925: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusolver64_11.dll'; dlerror: cusolver64_11.dll not found
2021-12-17 16:55:11.739984: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusparse64_11.dll'; dlerror: cusparse64_11.dll not found
2021-12-17 16:55:11.741035: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found
2021-12-17 16:55:11.741055: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1850] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2021-12-17 16:55:11.741263: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
C:\Users\eferg.conda\envs\ketos_env_py37\lib\site-packages\keras\optimizer_v2\adam.py:105: UserWarning: The lr
argument is deprecated, use learning_rate
instead.
super(Adam, self).init(name, **kwargs)
Testing Pycharm with virtual environment using python 3.7
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] on win32
runfile('C:/Ketos/PythonKetos/Test.py', wdir='C:/Ketos/PythonKetos')
2021-12-18 08:28:54.478835: 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-12-18 08:28:54.479125: 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.
2021-12-18 08:28:56.677565: 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-12-18 08:28:56.679343: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublas64_11.dll'; dlerror: cublas64_11.dll not found
2021-12-18 08:28:56.681063: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublasLt64_11.dll'; dlerror: cublasLt64_11.dll not found
2021-12-18 08:28:56.682653: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2021-12-18 08:28:56.684143: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found
2021-12-18 08:28:56.685645: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusolver64_11.dll'; dlerror: cusolver64_11.dll not found
2021-12-18 08:28:56.687083: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusparse64_11.dll'; dlerror: cusparse64_11.dll not found
2021-12-18 08:28:56.688397: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found
2021-12-18 08:28:56.688727: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1850] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2021-12-18 08:28:56.689669: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
C:\Ketos\PythonKetos\venv\lib\site-packages\keras\optimizer_v2\adam.py:105: UserWarning: The lr
argument is deprecated, use learning_rate
instead.
super(Adam, self).init(name, **kwargs)
Backend TkAgg is interactive backend. Turning interactive mode on.
Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.3.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.3.3\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Ketos/PythonKetos/Test.py", line 13, in
annot_val = pd.read_csv("annotations_val.csv")
File "C:\Ketos\PythonKetos\venv\lib\site-packages\pandas\util_decorators.py", line 311, in wrapper
return func(*args, **kwargs)
File "C:\Ketos\PythonKetos\venv\lib\site-packages\pandas\io\parsers\readers.py", line 586, in read_csv
return _read(filepath_or_buffer, kwds)
File "C:\Ketos\PythonKetos\venv\lib\site-packages\pandas\io\parsers\readers.py", line 482, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "C:\Ketos\PythonKetos\venv\lib\site-packages\pandas\io\parsers\readers.py", line 811, in init
self._engine = self._make_engine(self.engine)
File "C:\Ketos\PythonKetos\venv\lib\site-packages\pandas\io\parsers\readers.py", line 1040, in _make_engine
return mappingengine # type: ignore[call-arg]
File "C:\Ketos\PythonKetos\venv\lib\site-packages\pandas\io\parsers\c_parser_wrapper.py", line 51, in init
self._open_handles(src, kwds)
File "C:\Ketos\PythonKetos\venv\lib\site-packages\pandas\io\parsers\base_parser.py", line 229, in _open_handles
errors=kwds.get("encoding_errors", "strict"),
File "C:\Ketos\PythonKetos\venv\lib\site-packages\pandas\io\common.py", line 707, in get_handle
newline="",
FileNotFoundError: [Errno 2] No such file or directory: 'annotations_val.csv'