[英]Trying to classify my own images with tensorflow
I have just downloaded tensorflow and I'm trying to classify some images of my own through the command line. 我刚刚下载了tensorflow,并且试图通过命令行对自己的一些图像进行分类。
What I've done until now is: 到目前为止,我所做的是:
$ sudo apt-get install python-pip python-dev
# Ubuntu/Linux 64-bit, CPU only, Python 2.7
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0rc2-cp27-none-linux_x86_64.whl
sudo pip install --upgrade $TF_BINARY_URL
#and finally, to install and run tensorflow classifier
$python classify_image.py
which worked fine. 效果很好。 However I cannot find how to supply my own images for classification.
但是我找不到如何提供自己的图像进行分类的方法。 I'm aware of the --image_file filename.jpg however I cannot find where the images are supposed to be stored in order for this to work.
我知道--image_file filename.jpg,但是我找不到应该将图像存储在什么位置才能正常工作。 I've tried giving the absolute path,
我尝试给出绝对路径,
$python classify_image.py --image_file /home/usr/Desktop/ball.jpg
but I get a "file does not exist" warning. 但我收到“文件不存在”的警告。
Full error: http://imgur.com/wcn2QlI Interesting thing is that now that I restarted the virtual machine it re-downloaded the model for some reason. 完整错误: http : //imgur.com/wcn2QlI有趣的是,由于重新启动了虚拟机,由于某种原因它重新下载了模型。
Is there something more to this, do I have to change the source code in some way? 除此之外,还需要以某种方式更改源代码吗?
Thanks in advance 提前致谢
The scripts, including examples, are all stored in your pip installation path. 这些脚本(包括示例)全部存储在您的pip安装路径中。
Note that you have to pip install before: sudo pip install --upgrade $TF_BINARY_URL
. 请注意,您必须先进行pip安装:
sudo pip install --upgrade $TF_BINARY_URL
。
For instance, as above, it is probably here: ./usr/local/lib/python2.7/dist-packages/tensorflow/models/image/imagenet/classify_image.py
. 例如,如上所述,可能在此处:
./usr/local/lib/python2.7/dist-packages/tensorflow/models/image/imagenet/classify_image.py
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.