Keras和Spyder的奇怪错误 [英] Strange error with Keras and Spyder
问题描述
我正在使用Spyder与Keras一起做一些小项目,并且时不时地(我还没有确定出现它的代码中的内容)我得到了以下消息:
I'm using Spyder to do some small projects with Keras, and every now and then (I haven't pinned down what it is in the code that makes it appear) I get this message:
File "~/.local/lib/python3.5/site-packages/google/protobuf/descriptor_pb2.py", line 1771, in <module>
__module__ = 'google.protobuf.descriptor_pb2'
TypeError: A Message class can only inherit from Message
很奇怪,如果我使用终端在Spyder之外执行程序,则不会引发此异常.我环顾四周,发现没有人在使用Keras时遇到此错误.
Weirdly, this exception is not raised if I execute the program outside of Spyder, using the terminal. I've looked around and I have found no one who has encountered this error while using Keras.
重新启动Spyder会使它消失,但令人沮丧.可能是什么原因造成的?
Restarting Spyder makes it go away, but it's frustrating. What could be causing it?
推荐答案
好吧,我找到了原因:在Keras完全加载之前中断了执行.
Ok, I found the cause: interrupting the execution before Keras fully loads.
如重新启动Spyder(或只是控制台)之前所说的那样.
As said before restarting Spyder (or just the console) solves it.
这篇关于Keras和Spyder的奇怪错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!