简体   繁体   English

尝试使用张量流对我自己的图像进行分类

[英]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.

相关问题 尝试执行 Tensorflow 教程时出现错误 服装图像分类 - Run errors while trying to excute Tensorflow tutorial Classify images of clothing 尝试在 google Colab 中使用 tensorflow 对图像进行分类,我无法让我的目标数组形状与 output 形状的尺寸相匹配 - Trying to classify images using tensorflow in google Colab, am having trouble with getting my target array shape to match dimension of output shape 使用 Tensorflow deeplab 可视化我自己的一组图像 - Visualizing my own set of images with Tensorflow deeplab TensorFlow:从一个文件夹中分类多个图像 - TensorFlow: Classify multiple images from a folder 我如何在Tensorflow中准备自己的数据集(数千张图片)? - How i can prepare my own dataset (thousand of images) in Tensorflow? 如何使用 tensorflow model 预测我自己的图像 - How to use tensorflow model for predicting my own images 如何在TensorFlow中使用我自己的图像? - How do i use my own images in TensorFlow? Tensorflow-用我自己的图像测试mnist神经网络 - Tensorflow - Testing a mnist neural net with my own images 无法与我的 TensorFlow model 分类:FailedPreconditionError - Cannot classify with my TensorFlow model: FailedPreconditionError 尝试在Tensorflow高级API上编写我自己的损失函数 - Trying to write my own loss function on Tensorflow high level API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM