Okay.When I ran the codes below, the feedback shown in the next line is only Using Theano backend.
#Allow relative imports to directories above lesson1/
sys.path.insert(1, os.path.join(sys.path[0], '..'))
#import modules
from utils import *
from vgg16 import Vgg16
#Instantiate plotting tool
#In Jupyter notebooks, you will need to run this command before doing any plotting
%matplotlib inline
And also I have tried this config(Keras 1.22.),but it doesn’t work.
I have started nvidia-docker container before already.
{
"epsilon": 1e-07,
"floatx": "float32",
"image_data_format": "channels_first",
"backend": "theano",
"image_dim_ordering": "th"
}
I try to find out my .theanorc file in my nvidia-docker envirment.
But I cant.
I built the docker envirment based on Ubuntu16.04 with TF on nvidia-docker .
Then I enter the below codes into the bash line.
sudo nvidia-docker exec -ti container_name /bin/bash
.theanorc file is not existed in home directory.
SO I build one like this
root@514698e33bc6:~# vim ~/.theanorc
When I enter
[global]
floatX = float32
device = gpu
[nvcc]
fastmath = True
Another error appeared what made me confused.
What can I do next?
Using Theano backend.
ImportErrorTraceback (most recent call last)
<ipython-input-10-f725a731952c> in <module>()
3 from glob import glob
4 import numpy as np
----> 5 from vgg16 import Vgg16# Import our class, and instantiate
6 from vgg16bn import Vgg16BN
7
/notebooks/tfv_data/vgg16.py in <module>()
7 from scipy.ndimage.interpolation import zoom
8
----> 9 from keras.utils.data_utils import get_file
10 from keras import backend as K
11 from keras.layers.normalization import BatchNormalization
/usr/local/lib/python2.7/dist-packages/keras/__init__.py in <module>()
1 from __future__ import absolute_import
----> 2 from . import backend
3 from . import datasets
4 from . import engine
5 from . import layers
/usr/local/lib/python2.7/dist-packages/keras/backend/__init__.py in <module>()
62 if _BACKEND == 'theano':
63 sys.stderr.write('Using Theano backend.\n')
---> 64 from .theano_backend import *
65 elif _BACKEND == 'tensorflow':
66 sys.stderr.write('Using TensorFlow backend.\n')
/usr/local/lib/python2.7/dist-packages/keras/backend/theano_backend.py in <module>()
----> 1 import theano
2 from theano import tensor as T
3 from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
4 from theano.tensor.signal import pool
5 from theano.tensor.nnet import conv3d2d
/usr/local/lib/python2.7/dist-packages/theano/__init__.py in <module>()
64 object2, utils)
65
---> 66 from theano.compile import (
67 SymbolicInput, In,
68 SymbolicOutput, Out,
/usr/local/lib/python2.7/dist-packages/theano/compile/__init__.py in <module>()
26 from theano.compile.builders import *
27
---> 28 from theano.compile.function import function, function_dump
/usr/local/lib/python2.7/dist-packages/theano/compile/function.py in <module>()
16 import numpy as np
17 import warnings
---> 18 from theano import compat
19
20 __docformat__ = "restructuredtext en"
ImportError: cannot import name compat
I’m fresh on docker and theano. Thanks for your help!