theano g++ not detected
Asked Answered
C

6

18

I installed theano but when I try to use it I got this error:

WARNING (theano.configdefaults): g++ not detected! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded.

I installed g++, and put the correct path in the environment variables, so it is like theano does not detect it.

Does anyone know how to solve the problem or which may be the cause?

Chilson answered 19/4, 2016 at 15:31 Comment(0)
B
7

I had this occur on OS X after I updated XCode (through the App Store). Everything worked before the update, but after the update I had to start XCode and accept the license agreement. Then everything worked again.

Boat answered 19/9, 2016 at 8:50 Comment(1)
On top of this I had to restart the computer because it was initially being slow and then stopped working together, complaining about an old numpy installation. Restart did the job.Merocrine
P
6

On Windows, you need to install mingw to support g++. Usually, it is advisable to use Anaconda distribution to install Python. Theano works with Python3.4 or older versions. You can use conda install command to install mingw.

Panta answered 15/6, 2016 at 21:45 Comment(2)
After installing mingw I started to get "No module named cutils_ext" and lost two hours figuring out the problem. Thank you (!)Wisner
You can find supported versions of Python here: deeplearning.net/software/theano/requirements.htmlHowdah
S
4

I solved this probelm just now on Windows 10 with Anaconda3. First apply

conda install mingw

in the command line.

If one comes across this problem

CondaIOError: IO error: Missing write permissions in: C:\ProgramData\Anaconda3"

change the attribute in the safety tab of the folder in which you installed Anaconda; make sure user has write permissions to this folder.

Selfreliance answered 8/5, 2017 at 8:30 Comment(0)
T
3

This is the error that I experienced in my mac running jupyter notebook with a python 3.5 kernal hope this helps someone, i am sure rggir is well sorted at this stage :)

Error Using Theano backend. WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.

Cause update of XCode (g++ compiler) without accepting terms and conditions, this was pointed out above thanks Emiel

Resolution:

  1. type g++ --version in the mac terminal
  2. "Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo." is output as an error
  3. launch Xcode and accept terms and conditions
  4. return g++ --version in the terminal
  5. Something similar to the following will be returned to show that Xcode has been fully installed and g++ is now available to keras
    1. Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    2. Apple LLVM version 8.0.0 (clang-800.0.42.1)
    3. Target: x86_64-apple-darwin15.6.0
    4. Thread model: posix
    5. InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  6. Restart you machine… I am sure there are some more complicated steps that someone smarter than me can add here to make this faster
  7. Run the model.fit function of the keras application which should run faster now … win!
Tasha answered 20/11, 2016 at 15:11 Comment(0)
C
0

Run the following command in centos

yum install gcc-c++

then it will work

Cloak answered 9/11, 2018 at 17:23 Comment(0)
M
0

I had this issue also on MAC. I also couldn't install XCode through the app store so instead installed through the terminal using:

xcode-select --install
Mortgagee answered 29/11, 2021 at 16:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.