WaqasSultani / AnomalyDetectionCVPR2018

503 stars 185 forks source link

AttributeError: module 'theano.sandbox' has no attribute 'cuda' #58

Closed cervantes-loves-ai closed 5 years ago

cervantes-loves-ai commented 5 years ago

facing this error when try to train.

python3 TrainingAnomalyDetector_public.py Using TensorFlow backend. Traceback (most recent call last): File "TrainingAnomalyDetector_public.py", line 26, in theano.sandbox.cuda.use('gpu0') AttributeError: module 'theano.sandbox' has no attribute 'cuda'

also tried THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 and THEANO_FLAGS=device=cuda0

but got this error

THEANO_FLAG S=device=cuda0 python3 TrainingAnomalyDetector_public.py Using TensorFlow backend. Can not use cuDNN on context None: cannot compile with cuDNN. We got this error: b'/tmp/try_flags_c23bulok.c:4:19: fatal error: cudnn.h: No such file or directory\ncompilation terminated.\n' Mapped name None to device cuda0: GeForce GTX 1080 Ti (0000:01:00.0) Traceback (most recent call last): File "TrainingAnomalyDetector_public.py", line 26, in theano.sandbox.cuda.use('gpu0') AttributeError: module 'theano.sandbox' has no attribute 'cuda'

thanks in advance.

SateeshKumar21 commented 5 years ago

Add the lines: import os os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,device=cuda0,dnn.enabled=False,floatX=float32" os.environ["KERAS_BACKEND"] = "theano"

and comment out line 26 i.e theano.sandbox.cuda.use('gpu0')