Tensorflow Windows-Zugriff auf Ordner Verweigert:“NewRandomAccessFile Fehler beim Erstellen/Öffnen: Zugriff verweigert. ; Input/output error"

Kürzlich installierte ich Tensorflow für Windows. Ich bin versucht ein basic-tutorial, in dem ich zugreifen zu können, müssen Sie einen Ordner mit sub-Ordner von Bildern.

Ich bin nicht in der Lage, Zugriff auf den Ordner mit den Bildern, weil "Zugriff verweigert". Dies geschieht sowohl in der Anaconda 4.2 prompt und in Pycharm, und mit dem basic-Python-3.5 Verteilung.

Habe ich administrator-Rechte, um alles und ich habe alles neu installiert von software heute so es ist alles aktualisiert, um neuesten Versionen.

Jede Meinung oder Hilfe wäre sehr geschätzt werden!

# change this as you see fit
image_path = 'C:/moles'

# Read in the image_data
image_data = tf.gfile.FastGFile(image_path, 'rb').read()

# Loads label file, strips off carriage return
label_lines = [line.rstrip() for line
               in tf.gfile.GFile("/tf_files/retrained_labels.txt")]

# Unpersists graph from file
with tf.gfile.FastGFile("/tf_files/retrained_graph.pb", 'rb') as f:
    graph_def = tf.GraphDef()
    graph_def.ParseFromString(f.read())
    _ = tf.import_graph_def(graph_def, name='')

with tf.Session() as sess:
    # Feed the image_data as input to the graph and get first prediction
    softmax_tensor = sess.graph.get_tensor_by_name('final_result:0')

    predictions = sess.run(softmax_tensor, \
                           {'DecodeJpeg/contents:0': image_data})

    # Sort to show labels of first prediction in order of confidence
    top_k = predictions[0].argsort()[-len(predictions[0]):][::-1]

    for node_id in top_k:
        human_string = label_lines[node_id]
        score = predictions[0][node_id]
        print('%s (score = %.5f)' % (human_string, score))

"C:\Program Files\Anaconda3\python.exe" C:/Users/Ryan/Desktop/tfupdate/tf.py
    Traceback (most recent call last):

      File "C:/Users/Ryan/Desktop/tfupdate/tf.py", line 7, in <module>
        image_data = tf.gfile.FastGFile(image_path, 'rb').read()

      File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 106, in read
        self._preread_check()

      File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 73, in _preread_check
        compat.as_bytes(self.__name), 1024 * 512, status)

      File "C:\Program Files\Anaconda3\lib\contextlib.py", line 66, in __exit__
        next(self.gen)

      File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 469, in raise_exception_on_not_ok_status
        pywrap_tensorflow.TF_GetCode(status))

    tensorflow.python.framework.errors_impl.UnknownError: NewRandomAccessFile failed to Create/Open: C:/moles : Access is denied.
    ; Input/output error

    Process finished with exit code 1
  • Ist C:/moles den Namen einer image-Datei? Die Ursache für den Fehler scheint zu sein, dass C:/moles ist ein Ordner, aber Sie versuchen, es zu Lesen wie eine Datei.
  • Nur Sie schaffen Maulwürfe-Verzeichnis im Laufwerk c und der Fehler ist gelöst.
InformationsquelleAutor Ryan.f | 2016-12-13
Schreibe einen Kommentar