Spyder: Spyder problem, kernel died all the time when tried to run session in tensorflow, is it not enough gpu to run ?

Created on 9 Dec 2017  Â·  18Comments  Â·  Source: spyder-ide/spyder

Description of your problem

The problem show up all the time, my gpu is 750 ti 2GB. Is it not enough to run sessions in tensorflow ??
Error showed below:

An error ocurred while starting the kernel
OpenCV Error: Assertion failed (depth == CV_8U || depth == CV_16U || depth == CV_32F) in cv::cvtColor, file ......modulesimgprocsrccolor.cpp, line 7935
2017󈚰󈚭 16:15:29.181208: W C:tf_jenkinshomeworkspacerel‑winMwindows‑gpuPY35tensorflowcoreplatformcpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017󈚰󈚭 16:15:29.181222: W C:tf_jenkinshomeworkspacerel‑winMwindows‑gpuPY35tensorflowcoreplatformcpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017󈚰󈚭 16:15:29.409230: I C:tf_jenkinshomeworkspacerel‑winMwindows‑gpuPY35tensorflowcorecommon_runtimegpugpu_device.cc:955] Found device 0 with properties:
name: GeForce GTX 750 Ti
major: 5 minor: 0 memoryClockRate (GHz) 1.1105
pciBusID 0000:01:00.0
Total memory: 2.00GiB
Free memory: 1.65GiB
2017󈚰󈚭 16:15:29.409246: I C:tf_jenkinshomeworkspacerel‑winMwindows‑gpuPY35tensorflowcorecommon_runtimegpugpu_device.cc:976] DMA: 0
2017󈚰󈚭 16:15:29.409249: I C:tf_jenkinshomeworkspacerel‑winMwindows‑gpuPY35tensorflowcorecommon_runtimegpugpu_device.cc:986] 0: Y
2017󈚰󈚭 16:15:29.409268: I C:tf_jenkinshomeworkspacerel‑winMwindows‑gpuPY35tensorflowcorecommon_runtimegpugpu_device.cc:1045] Creating TensorFlow device (/gpu:0) ‑> (device: 0, name: GeForce GTX 750 Ti, pci bus id: 0000:01:00.0)

What steps will reproduce the problem?

  1. Try to run sess = tf.session()
  2. Run sess.run(conv1, feed_dict={img:Image})
  3. Error showed up

What is the expected output? What do you see instead?

Please provide any additional information below

Versions and main components

  • Spyder Version: 3.5
  • Python Version: 3.5
  • Qt Version:
  • PyQt Version:
  • Operating system: windows 10

Dependencies

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:

Most helpful comment

Okay, thanks. It seems probable that the message printed in the IPython Console is indeed just a warning, as it should be, while the actual error is the one printed in the Console:

js: Not allowed to load local resource: file:///C:/Users/Hesam/AppData/Local/conda/conda/envs/P-3.6.5-CPU/lib/site-packages/spyder/utils/help/static/css/default.css

which is indeed Snyder-specific.

One thing: That error sounds like Chromium, which the new Qt web backend in 5.9 is based off, whereas QtWebKit is what's used in 5.6. By any chance, are you running under Qt/PyQt 5.9 in that environment (you can check with conda list qt with that environment activated from the Anaconda prompt, or from the About screen in Spyder's Help menu)? If so, can you switch to 5.6 with conda install pyqt=5.6 and see if it changes anything?

All 18 comments

Thanks for reporting. I'm not an expert at GPU computing, but it looks like your GPU might be too long/not support certain CUDA/OpenCL instructions OpenCV is trying to use? No idea.

In any case, this does not appear to be in any way a Spyder error, so you should presumably close this issue. You could, e.g. try asking on an appropriate Stack Exchange site, or if you can isolate it to a problem specifically with e.g. OpenCV, you could file a bug there. Best of luck!

Hi, I have almost the same problem, I run Tensorflow on the CPU, but frequently I get this error message in the console:

2018-06-09_11-43-38

and this error in the CMD:

js: Not allowed to load local resource: file:///C:/Users/Hesam/AppData/Local/conda/conda/envs/P-3.6.5-CPU/lib/site-packages/spyder/utils/help/static/css/default.css

I run an identical code inside the same Anaconda environment inside VSCode, but I don't get this error, therefore it should be related to the Spyder.

@VanitarNordic Doesn't seem to be related to this issue, since its a very different error with Tensorflow running on a GPU, not on a CPU as in your example.

The first "error" should be just a warning that you can get better performance if you recompile Tensorflow for your specific CPU model. The second appears to be related to Spyder's help pane not loading. Very odd. @ccordoba12 ?

Also, can you retry the same steps in QtConsole (jupyter qtconsole) instead and see if the problem reoccurs? You may also want to consult the Spyder Troubleshooting Guide, specifically the Basic First Aid and Emergency CPR sections.

Yes, actually I tried with PyCharm and this error appears there as a warning, but here it appears as a error and crashes the iPython console and that error message shows up in the CMD.

Okay, but what about in QtConsole (from Anaconda Navigator or jupyter qtconsole at the command line), as I asked above?

Sure, I'll test and tell you the income.

Thanks!

Alright, I tested. it works Okay. I run the code inside qtconsole, but I got that error as a warning and it continued to its normal operation without any crash.

2018-06-09_23-36-28

Okay, thanks. It seems probable that the message printed in the IPython Console is indeed just a warning, as it should be, while the actual error is the one printed in the Console:

js: Not allowed to load local resource: file:///C:/Users/Hesam/AppData/Local/conda/conda/envs/P-3.6.5-CPU/lib/site-packages/spyder/utils/help/static/css/default.css

which is indeed Snyder-specific.

One thing: That error sounds like Chromium, which the new Qt web backend in 5.9 is based off, whereas QtWebKit is what's used in 5.6. By any chance, are you running under Qt/PyQt 5.9 in that environment (you can check with conda list qt with that environment activated from the Anaconda prompt, or from the About screen in Spyder's Help menu)? If so, can you switch to 5.6 with conda install pyqt=5.6 and see if it changes anything?

Yes, I use Qt 5.9.4 and PyQt 5.9.2.

If so, can you switch to 5.6 with conda install pyqt=5.6 and see if it changes anything?

I will test. Besides I have to mention that I have tested the reset to default but it did not help. The only thing that I have not tested is to create a new conda environment, but since other editors did not show this specific problem with this environment, I try to analyze it. The Spyder is one head above them and I am sure this will be fixed. even if it could not, I'll re-new the environment, it will not cost me :-)

Okay, thanks again for the quick followup and your kind words ^_^. Cloning a new conda environment and installing the relevant packages is a cheap and nondestructive operation, especially since you already have everything installed. Running

$ conda create --name spyder-qt56 --clone P-3.6.5-CPU
$ activate spyder-qt56
$ install pyqt=5.6
$ spyder

should do the trick and only take a few seconds on a fast machine, which not touching any of your existing environments.

I did, it also downgraded the Qt to Qt 5.6.2, but the Spyder did not run. I mean after typing Spyder in the CMD and pressing enter, it takes 2-3 seconds and nothing shows up, after than it just releases the CMD.

I also tested the new environment without downgrading the PyQt but the same thing happened like before. The thing is when we run the code, we don't see this warning message like other editors, but when appears, it crashes the iPython console.

Alright, let me tell you what happened. Most likely the Spyder is right. The problem is the newly published Keras 2.2.0 which seems to hold tons of bugs! I downgraded to the Keras 2.1.6 and several issues were solved, including this one (so far).

Hmm; likely one of the packages that the 2.2.0 update included was a Spyder dependency (or sub-dependency, etc) and caused a conflict of some sort. Glad you got it working!

Actually the only two extra packages which installs with Keras 2.20, which do not belong to previous versions are: keras-applications and keras-preprocessing. Rest of the packages are intact.

Yes, but it wouldn't likely be an extra package newly installed, but rather an update to an existing dependency that broke something. Do the updates update any dependencies, or just the core Keras packages? Alternatively, it could be some specific package or code path they're newely calling that's causing a problem, but I'm not sure what—just based on that error, my naive suspicion is something related to QtWebKit/QtWebEngine but its hard to say for sure.

The new package does not update anything (other packages) because all packages were/are updated before and pass the new package minimum requirement.

Alright, with discussion with other users I realized that a specific function inside the keras 2.2.0 causes a memory leak and crash. K.clear_session()
in other editors it does not cause the console to crash, but it breaks the python code in the middle of running.

it might be the reason for this weird Spyder crash.

Was this page helpful?
0 / 5 - 0 ratings