-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在我的机器上运行您的程序时,我把涉及 google.colab的代码注释掉,结果出现如下错误,请问是这么回事? #1
Comments
AppliedDataSciencePartners/DeepReinforcementLearning#3 我查了下可能是这个问题,我本地运行的时候没有问题,也有可能是用的keras和tensorflow.keras的backend混淆了有关系,colab应该是默认tf的backend
…------------------ 原始邮件 ------------------
发件人: "QuanhanSun/Deep-and-Confident-Prediction-for-Time-Series-at-Uber" <[email protected]>;
发送时间: 2020年12月18日(星期五) 中午12:36
收件人: "QuanhanSun/Deep-and-Confident-Prediction-for-Time-Series-at-Uber"<Deep-and-Confident-Prediction-for-Time-Series-at-Uber@noreply.github.com>;
抄送: "Subscribed"<[email protected]>;
主题: [QuanhanSun/Deep-and-Confident-Prediction-for-Time-Series-at-Uber] 在我的机器上运行您的程序时,我把涉及 google.colab的代码注释掉,结果出现如下错误,请问是这么回事? (#1)
注释掉的代码
from google.colab import drive
drive.mount('/content/drive')
import os
path = "/content/drive/My Drive/SaicAILab"
os.chdir(path)
运行错误:发生在 ’预训练模型图解‘处:
from IPython.display import SVG
from keras.utils.vis_utils import model_to_dot
SVG(model_to_dot(ae_model,show_shapes= True, show_layer_names=True, dpi=65).create(prog='dot', format='svg'))
错误提示:
('Failed to import pydot. You must pip install pydot and install graphviz (https://graphviz.gitlab.io/download/), ', 'for pydotprint to work.')
AttributeError Traceback (most recent call last)
in
2 from keras.utils.vis_utils import model_to_dot
3
----> 4 SVG(model_to_dot(ae_model,show_shapes= True, show_layer_names=True, dpi=65).create(prog='dot', format='svg'))
AttributeError: 'NoneType' object has no attribute 'create'
根据提示我安装好了pydot和graphviz 两个包后,重新运行,结果还是出同样的错:
控制台输出如下:
(Keras) F:\AnalyticsZoo\UberPaperimplement>pip install pydot
Collecting pydot
Downloading pydot-1.4.1-py2.py3-none-any.whl (19 kB)
Requirement already satisfied: pyparsing>=2.1.4 in c:\users\wxy\anaconda3\envs\keras\lib\site-packages (from pydot) (2.4.7)
Installing collected packages: pydot
Successfully installed pydot-1.4.1
(Keras) F:\AnalyticsZoo\UberPaperimplement>pip install graphviz
Collecting graphviz
Downloading graphviz-0.15-py2.py3-none-any.whl (18 kB)
Installing collected packages: graphviz
Successfully installed graphviz-0.15
(Keras) F:\AnalyticsZoo\UberPaperimplement>jupyter notebook
[I 12:28:27.235 NotebookApp] Serving notebooks from local directory: F:\AnalyticsZoo\UberPaperimplement
[I 12:28:27.236 NotebookApp] Jupyter Notebook 6.1.5 is running at:
[I 12:28:27.238 NotebookApp] http://localhost:8888/?token=d754dc8d300c895d6009fe14a08f530ac339d74dc5b2522b
[I 12:28:27.242 NotebookApp] or http://127.0.0.1:8888/?token=d754dc8d300c895d6009fe14a08f530ac339d74dc5b2522b
[I 12:28:27.243 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 12:28:27.293 NotebookApp]
To access the notebook, open this file in a browser: file:///C:/Users/wxy/AppData/Roaming/jupyter/runtime/nbserver-16972-open.html Or copy and paste one of these URLs: http://localhost:8888/?token=d754dc8d300c895d6009fe14a08f530ac339d74dc5b2522b or http://127.0.0.1:8888/?token=d754dc8d300c895d6009fe14a08f530ac339d74dc5b2522b
[I 12:28:33.832 NotebookApp] Kernel started: 9de98f90-7991-4cec-86ce-9814f3a1fb6e, name: python3
2020-12-18 12:28:54.044539: I tensorflow/core/platform/cpu_feature_guard.cc:142] 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.
[I 12:30:33.767 NotebookApp] Saving file at /Deep_and_Confident_Prediction_for_Time_Series_at_Uber.ipynb
jupyter notebook 输出如下:
预训练模型图解
In [15]:
from IPython.display import SVG
from keras.utils.vis_utils import model_to_dot
SVG(model_to_dot(ae_model,show_shapes= True, show_layer_names=True, dpi=65).create(prog='dot', format='svg'))
('Failed to import pydot. You must pip install pydot and install graphviz (https://graphviz.gitlab.io/download/), ', 'for pydotprint to work.')
AttributeError Traceback (most recent call last)
in
2 from keras.utils.vis_utils import model_to_dot
3
----> 4 SVG(model_to_dot(ae_model,show_shapes= True, show_layer_names=True, dpi=65).create(prog='dot', format='svg'))
AttributeError: 'NoneType' object has no attribute 'create'
请教如何解决此问题?多谢!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
我也遇到了大概相似的问题(已解决)我遇到问题和解决问题的过程如下:
显示:
《jupyter notebook中出现ValueError: signal only works in main thread 报错 即 长时间in[*] 解决办法》https://blog.csdn.net/jackhh1/article/details/103435550
《Jupyter Notebook "signal only works in main thread"》
大概如下: 总得来说
这些代码似乎都没有用,我把它们注释之后整体运行是没有错误的!!! |
注释掉的代码
from google.colab import drive
drive.mount('/content/drive')
import os
path = "/content/drive/My Drive/SaicAILab"
os.chdir(path)
运行错误:发生在 ’预训练模型图解‘处:
from IPython.display import SVG
from keras.utils.vis_utils import model_to_dot
SVG(model_to_dot(ae_model,show_shapes= True, show_layer_names=True, dpi=65).create(prog='dot', format='svg'))
错误提示:
('Failed to import pydot. You must
pip install pydot
and install graphviz (https://graphviz.gitlab.io/download/), ', 'forpydotprint
to work.')AttributeError Traceback (most recent call last)
in
2 from keras.utils.vis_utils import model_to_dot
3
----> 4 SVG(model_to_dot(ae_model,show_shapes= True, show_layer_names=True, dpi=65).create(prog='dot', format='svg'))
AttributeError: 'NoneType' object has no attribute 'create'
根据提示我安装好了pydot和graphviz 两个包后,重新运行,结果还是出同样的错:
控制台输出如下:
(Keras) F:\AnalyticsZoo\UberPaperimplement>pip install pydot
Collecting pydot
Downloading pydot-1.4.1-py2.py3-none-any.whl (19 kB)
Requirement already satisfied: pyparsing>=2.1.4 in c:\users\wxy\anaconda3\envs\keras\lib\site-packages (from pydot) (2.4.7)
Installing collected packages: pydot
Successfully installed pydot-1.4.1
(Keras) F:\AnalyticsZoo\UberPaperimplement>pip install graphviz
Collecting graphviz
Downloading graphviz-0.15-py2.py3-none-any.whl (18 kB)
Installing collected packages: graphviz
Successfully installed graphviz-0.15
(Keras) F:\AnalyticsZoo\UberPaperimplement>jupyter notebook
[I 12:28:27.235 NotebookApp] Serving notebooks from local directory: F:\AnalyticsZoo\UberPaperimplement
[I 12:28:27.236 NotebookApp] Jupyter Notebook 6.1.5 is running at:
[I 12:28:27.238 NotebookApp] http://localhost:8888/?token=d754dc8d300c895d6009fe14a08f530ac339d74dc5b2522b
[I 12:28:27.242 NotebookApp] or http://127.0.0.1:8888/?token=d754dc8d300c895d6009fe14a08f530ac339d74dc5b2522b
[I 12:28:27.243 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 12:28:27.293 NotebookApp]
[I 12:28:33.832 NotebookApp] Kernel started: 9de98f90-7991-4cec-86ce-9814f3a1fb6e, name: python3
2020-12-18 12:28:54.044539: I tensorflow/core/platform/cpu_feature_guard.cc:142] 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.
[I 12:30:33.767 NotebookApp] Saving file at /Deep_and_Confident_Prediction_for_Time_Series_at_Uber.ipynb
jupyter notebook 输出如下:
预训练模型图解
In [15]:
from IPython.display import SVG
from keras.utils.vis_utils import model_to_dot
SVG(model_to_dot(ae_model,show_shapes= True, show_layer_names=True, dpi=65).create(prog='dot', format='svg'))
('Failed to import pydot. You must
pip install pydot
and install graphviz (https://graphviz.gitlab.io/download/), ', 'forpydotprint
to work.')AttributeError Traceback (most recent call last)
in
2 from keras.utils.vis_utils import model_to_dot
3
----> 4 SVG(model_to_dot(ae_model,show_shapes= True, show_layer_names=True, dpi=65).create(prog='dot', format='svg'))
AttributeError: 'NoneType' object has no attribute 'create'
请教如何解决此问题?多谢!
The text was updated successfully, but these errors were encountered: