2017-05-18 8 views
-1

modelDCGAN(人工ニューラルネットワークの一種)のテンソルフローをテストしたかったのです。Pythonでファイルを開こうとしたときに許可が拒否されました

最初にmnistデータセットをダウンロードしてすべて抽出し、抽出したファイルをdataフォルダに保存しました。だから、データディレクトリは、このようなものです:

{data}->{mnist}->{t10k-images-idx3-ubyte(folder), t10k-labels-idx1-ubyte(folder), train-images-idx3-ubyte(folder), train-labels-idx1-ubyte(folder)} 

及びこれらのフォルダ内の、関連mnistバイナリファイルがあります。

はだから後、私はコマンドを使用してモデルをテストしたい:

python main.py --dataset mnist --input_height=28 --output_height=28 

はしかし、私はこのエラーが発生します:

{'batch_size':

64, 'beta1': 0.5, 'checkpoint_dir': 'checkpoint', 'crop': False, 'dataset': 'mnist', 'epoch': 25, 'input_fname_pattern': '*.jpg', 'input_height': 28, 'input_width': None, 'learning_rate': 0.0002, 'output_height': 28, 'output_width': None, 'sample_dir': 'samples', 'train': False, 'train_size': inf, 'visualize': False} 2017-05-19 06:39:26.142508: W c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow li brary wasn't compiled to use SSE instructions, but these are available on your m achine and could speed up CPU computations. 2017-05-19 06:39:26.142773: W c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow li brary wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations. 2017-05-19 06:39:26.142990: W c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow li brary wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations. 2017-05-19 06:39:26.143212: W c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow li brary wasn't compiled to use SSE4.1 instructions, but these are available on you r machine and could speed up CPU computations. 2017-05-19 06:39:26.143558: W c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow li brary wasn't compiled to use SSE4.2 instructions, but these are available on you r machine and could speed up CPU computations. 2017-05-19 06:39:26.143833: W c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow li brary wasn't compiled to use AVX instructions, but these are available on your m achine and could speed up CPU computations. 2017-05-19 06:39:26.144102: W c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow li brary wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. 2017-05-19 06:39:26.144438: W c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow li brary wasn't compiled to use FMA instructions, but these are available on your m achine and could speed up CPU computations. 2017-05-19 06:39:26.219026: I c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:887] Found device 0 with properties: name: GeForce 820M major: 2 minor: 1 memoryClockRate (GHz) 1.25 pciBusID 0000:03:00.0 Total memory: 2.00GiB Free memory: 1.94GiB 2017-05-19 06:39:26.219532: I c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:908] DMA: 0 2017-05-19 06:39:26.219721: I c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:918] 0: Y 2017-05-19 06:39:26.219874: I c:\tf_jenkins\home\workspace\release-win\device\gp u\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:950] Ignoring visi ble gpu device (device: 0, name: GeForce 820M, pci bus id: 0000:03:00.0) with Cu da compute capability 2.1. The minimum required Cuda capability is 3.0. Traceback (most recent call last): File "main.py", line 97, in tf.app.run() File "C:\Users\vafaee\Miniconda2\envs\tensorflow35\lib\site-packages\tensorflo w\python\platform\app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "main.py", line 61, in main sample_dir=FLAGS.sample_dir) File "C:\Users\vafaee\Documents\DCGAN-tensorflow-master\DCGAN-tensorflow-maste r\model.py", line 74, in init self.data_X, self.data_y = self.load_mnist() File "C:\Users\vafaee\Documents\DCGAN-tensorflow-master\DCGAN-tensorflow-maste r\model.py", line 467, in load_mnist fd = open(os.path.join(data_dir,'train-images-idx3-ubyte')) PermissionError: [Errno 13] Permission denied: './data\mnist\train-images-idx3 -ubyte'

私は管理者としてコマンドプロンプトを実行していますが、それはdidnの仕事はありません。

また、フォルダ/ファイルを右クリックし、[セキュリティ]タブにアクセスしてアクセス許可を確認することで、アクセス許可をチェックしました。すべてがうまく見えました。

これまでのところ、以前の質問を探して解決できませんでした。

私はWindows 8を使用しています。コードは、コーダ環境で実行しています。

この問題に関するお手伝いをお待ちしております。

+0

私はあなたにエスケープされていないバックスラッシュの問題があると言いたいと思います:少なくとも" tabulation char "の場合は' './data\mnist\train-images-idx3 -byte''です。 –

+0

私は分からなかった。もっと説明していただけますか? @jea – Kadaj13

+0

申し訳ありませんが、私は非常によく理解していませんでした。あなたはもうnをexplaiしてくださいできますか? @ jean-FrancoisFabre – Kadaj13

答えて

0

私は、以下の溶液を用いてこの問題を解決することができた:実は、このコードはLinuxの中で使用されるように書かれている

。しかし、私のプラットフォームはWindowsでした。 "model.py"スクリプトとload_mnist()関数では、データをロードするコードはdata_dir = os.path.join("./data", self.dataset_name)

でしたが、Windowsでは "./"コードで現在のディレクトリにアクセスすることはできません。この行があったソースコードで、その後

current_dir = os.getcwd() 
data1_dir = os.path.join(current_dir, 'data') 
data2_dir = os.path.join(data1_dir, 'mnist') 
data_dir = os.path.join(data2_dir, 'train-images-idx3-ubyte') 

:だから私は、次の行に次の行を変更 '、

FD =オープン(os.path.join(DATA_DIRが列車images- idx3-ubyte '))

ディレクトリを開こうとしました。だから私はこれに変更しました: `fd = open(os.path.join(data_dir、 'train-images.idx3-ubyte')、" r + ")

これは私のために働いています。問題は、このコードは、Windowsの部分を除いて、動作することが保証されているということです。ディレクトリを開くときに、ファイル自体に注意していました。 これは他の人にも役立つことを願っています。 `

関連する問題