(1)安装tensor flow
ubuntu:
① wget https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.1.0-cp34-cp34m-linux_x86_64.whl
②https://pypi.python.org/pypi/tensorflow ...ok
pip install tensorflow-1.1.0-cp34-cp34m-linux_x86_64.whl
tensorflow版本>0.8
mac:
sudo pip3 intall tensor flow
(2)下载vgg网络
http://www.vlfeat.org/matconvnet/models/beta16/imagenet-vgg-verydeep-19.mat
(3)下载源码
git clone https://github.com/jcjohnson/neural-style.git
(4)出图
python neural_style.py --content ./examples/1-content.jpg --styles ./examples/2-style1.jpg --output 222.jpg --network /tf/imagenet-vgg-verydeep-19.mat
question:
(1)AttributeError: 'module' object has no attribute 'matmul'
numpy 版本过低 要求1.10.0以上 python3以上
numpy要修改名字 不然manylinux1字段不支持
(2)protobuf 3.2.0
vim ~/.profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
source ~/.profile
(3)AttributeError: type object 'NewBase' has no attribute 'is_abstract'
six没有安装好,使用tar安装 python setup.py install
(4)AttributeError: 'module' object has no attribute 'global_variables_initializer'
1.官网clone最新版本
2.apt-get install cython
3.python setup.py build -j 4 install --prefix $HOME/.local