python


when run python code some kind of error occured


import tensorflow as tf
imagePath = '/home/sk/test_set'
image_list = tf.gfile.ListDirectory(imagePath)
for i in image_list:
image_data = tf.gfile.FastGFile(i, 'rb').read()
when excute this code error occured
Traceback (most recent call last):
File "/home/sk/tensorflow-classify/photos/as.py", line 18, in <module>
image_data = tf.gfile.FastGFile(i, 'rb').read()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 115, in read
self._preread_check()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 75, in _preread_check
compat.as_bytes(self.__name), 1024 * 512, status)
File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: 11.jpg
i think tf.gfile.FastGFile(i, 'rb').read() this is not properly working.
it works when file name is 1.jpg, but changing file name following error occurs
how can i fix this problem
It looks like the path imagePath = '/home/sk/test_set' is not correct or the method accepts relatives routes.
Check the example here
There are a FLAGS variable where defines all the routes, follow the leed based on your file structure, and where do you have the proyect

Related Links

Discord.py sending message twice
Crash when importing wmi.py
Reconstructing an exception from an extracted traceback
Appending unique mixed string using pandas or python
python setuptools Include man page in RPM
How do I move an empty array from a variable with multiple arrays?
Media images not showing, even though they successfully load on the page
Python Script won't run right when double-clicking .py
Frequently receiving 503 error when conducting Reddit search with PRAW
How to create an XML file with some elements containing CDATA
Python: will having python 2 and python 3 casues trouble? [duplicate]
Difference between 2 files in order
Global Dictionary Between Two Files
Python: In a for loop going through a list, how do you multiply by every other element of that list
How to set up multiple Dag directories in airflow
Uninstall Python 3.x on osx

Categories

HOME
sidekiq
antivirus
visualization
ubuntu-12.04
wampserver
appmaker
terrain
phonegap-cli
java-home
simpy
vsftpd
structuremap
iso
future
squarespace
sendkeys
netezza
opera-mini
mousewheel
rails-activerecord
spring-ws
explode
jquery-scrollify
tflearn
emv
bus-error
fetch-api
multichoiceitems
sharp
fabric-digits
ios-ui-automation
pace
bigcartel
readfile
s3cmd
linq-to-entities
common.logging
android-maps-v2
startapp
azure-availability-set
ti-basic
gist
azureportal
bnd
dwarf
text-classification
crystal-reports-8.5
jexl
photon-controller
httplib2
opencpu
windows-azure-pack
json-schema-validator
jackson-databind
faraday
handlebars.java
web-essentials
futuretask
graphical-logo
scrollspy
consensus
sqoop2
mser
dmp
node-inspector
eclipse-classpath
code-testing
wss
phpdocx
sanitization
real-time-updates
document-database
installshield-2009
zend-lucene
abnf
marmalade-edk
socketstream
enumerators
ninject-extensions
smooth
squeel
google-instant
idictionary
openvg
asp.net-mvc-controller
microsoft.ink
castle-validators
configurable

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App