用神经网络做了一个策略模型,但是报错。
DNN_future是一个策略文件,在这个文件里定义了DNN_future_Strategy(CtaTemplate)类,在类里面调用了一个神经网络模型DNN_Futrue_model_V2用于预测市场,模型已经训练好了。但是在策略中调用这个模型的时候,出现了报错,报错如下,求指教是什么原因?
感觉是无法调用tensorflow,不知道原因是什么,求大神指教。
vnpy.app.cta_strategy.strategies.DNN_future加载失败,触发异常:
Traceback (most recent call last):
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 110, in load_strategy_class_from_module
module = importlib.import_module(module_name)
File "c:\vnstudio\lib\importlib__init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\strategies\DNN_future.py", line 14, in <module>
import tensorflow as tf
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\init.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\init__.py", line 39, in <module>
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: 找不到指定的模块。
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
22:33:19 策略文件vnpy.app.cta_strategy.strategies.DNN_Futrue_Class加载失败,触发异常:
Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 110, in load_strategy_class_from_module
module = importlib.import_module(module_name)
File "c:\vnstudio\lib\importlib__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'vnpy.app.cta_strategy.strategies.DNN_Futrue_Class'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
22:33:19 策略文件strategies.DNN_Futrue_Class_V1加载失败,触发异常:
Traceback (most recent call last):
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 110, in load_strategy_class_from_module
module = importlib.import_module(module_name)
File "c:\vnstudio\lib\importlib__init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\1\strategies\DNN_Futrue_Class_V1.py", line 2, in <module>
import tensorflow as tf
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\init.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\init__.py", line 39, in <module>
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: 找不到指定的模块。
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
22:33:19 策略文件strategies.DNN_Futrue_Class_V2加载失败,触发异常:
Traceback (most recent call last):
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 110, in load_strategy_class_from_module
module = importlib.import_module(module_name)
File "c:\vnstudio\lib\importlib__init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\1\strategies\DNN_Futrue_Class_V2.py", line 12, in <module>
import tensorflow as tf
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\init.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\init__.py", line 39, in <module>
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\1\anaconda3\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: 找不到指定的模块。
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
22:33:19 策略文件strategies.DNN_future加载失败,触发异常:
Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 110, in load_strategy_class_from_module
module = importlib.import_module(module_name)
File "c:\vnstudio\lib\importlib__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\1\strategies\DNN_future.py", line 24, in <module>
from DNN_Futrue_Class_V2 import *
ModuleNotFoundError: No module named 'DNN_Futrue_Class_V2'