Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anaconda prompt crashes as soon as I activate tensorflow env

I have just installed Anaconda 3.7 in Windows 10. Then I have created a new env for tensorflow and installed it there. It got installed without any problem. Then I used the command conda install -c conda-forge keras to install Keras. While Keras installation was running, Anaconda Prompt crashed suddenly. I restarted it and I tried to activate my tensorflow env; but as soon as I try to activate it, Anaconda Prompt crashes!! Please take a look at my screenshot. How can I fix this? Thank you very much for your support. Ferari

Anaconda Prompt Crashes

like image 707
Ferari Avatar asked Nov 13 '18 00:11

Ferari


People also ask

How do I change from Anaconda prompt to TensorFlow?

How to work with that from a jupyter notebook based on the base environment? Close and reopen your jupyter notebook. Then in your jupyter notebook you will find the option, under "kernel" of "change kernel". Change kernel to your newly created kernel and you will be able to import tensorflow as tf and go on from there.


4 Answers

The problem could be due to the version of tensorflow - tensorboard mismatch. When you give the command conda install -c conda-forge keras for installing keras, the tensorflow and tensorboard versions gets changed.

I tried the following steps and it worked fine for me.

  • conda create -n tf python=3.6
  • activate tf
  • conda install keras

Installing keras will automatically install tensorflow.

like image 89
Sandhiya - Intel Avatar answered Nov 05 '22 05:11

Sandhiya - Intel


I was also facing the same error and i have resolved it by re creating the conda environment. It is happening due to version mismatch between couple of packages. Just delete the conda environment and re-create the environment but this time do not add tensorflow GPU package instead just add keras-gpu, it will take care everything.

I did the following things:

  1. deleted the same env

  2. created the same environment using

conda create -n myEnv python==3.6

  1. install keras gpu

conda install -c conda-forge keras-gpu

now it will install necessary packages and then you can activate the environment and use it

like image 45
Vaibhav K Avatar answered Nov 05 '22 06:11

Vaibhav K


I just had an issue with the same symptom. Instead of printing the error message, the activation of the conda environment exited the console application.

The scripts that run on activation can be found in ./etc/conda/activate.d inside the environment. The path to the environments can be found using conda env list. Check these scripts for any 'exit' commands, commenting them out if necessary. This should let you at least see the error message.

In my case the issue was caused by packages requiring MSVC compiler, and Visual Studio studio was not installed.

like image 43
Jon Nordby Avatar answered Nov 05 '22 06:11

Jon Nordby


I encountered the same problem. Solved by creating a new env and using

conda install -c hesi_m keras

This will install the latest versions of Keras and Tensorflow.

Turns out you will most likely get an outdated version of keras if you installed it with conda install -c conda-forge keras.

like image 32
Elena Kostyuchenko Avatar answered Nov 05 '22 07:11

Elena Kostyuchenko