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

How to add tuples y values if x values are the same?
what is the complexity of the code given below?
Apache not serving admin static files for django
Django dynamic object listing with foreign tables (many to many case)
aysncio cannot read stdin on Windows
Write multiple matches from regex to a file on a single line a certain way
one or more most frequent letter in string python
pandas - select/mask the first n elements by value
python filter files by modified time
Python, Multiprocessing: what to do if process.join() waits forever?
How to sum values in an iterator in a PySpark groupByKey()
Allauth will not save additional fields
Read Flask Session Cookie
How do I make my script take only numeric inputs without screwing it up
Incorrect output while reading text file in Python
PhantomJS - Permission Denied

Categories

HOME
cakephp-3.x
ibm-watson-cognitive
admin-on-rest
checkbox
angular-cli
rotation
raspbian
webrtc
fparsec
codeeffects
xtext
websphere-liberty
gimp
shipping
google-plus
lotus-notes
click
criteria
powershell-v3.0
oclint
jboss-eap-7
iso
jboss7.x
dlib
r-lavaan
scenebuilder
yeoman-generator
thumbnails
cython
tweets
servicemix
extractor
qsub
fabric
samsung-mobile
auditing
geopandas
strophe
entity-system
hawtio
geo
fabric-digits
nsurlconnection
ksoap
vmd
liquid-xml
office365connectors
poco-libraries
sql-like
cross-entropy
intellij-idea-2016
html-agility-pack
filepath
azure-availability-set
jags
web-deployment-project
openh264
fedora20
gce
build-process
spring-ioc
uistackview
activeweb
pax-web
listadapter
multilingual-app-toolkit
void
asymptote
loose-typing
site-prism
textkit
anti-patterns
connection-reset
team-build
manjaro
divide-by-zero
callstack
hiera
low-level
obfuscar
gyroscope-framework
errorprovider
node-imagemagick
csplit
svcutil.exe
flash-cc
chrome-for-android
bsod
robospice
client-side-scripting
iconv
dynamics-ax-2009
qss
cgpath
git-filter-branch
moq-3
plone-funnelweb
wcf-web-api
law-of-demeter
curljs
windows-live-id
querypath
camtasia
usability-testing
microsoft.ink
soft-keyboard
outlook-form

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