0
votes

I wanted to test tensorflow model of DCGAN (a kind of Artificial Neural Network).

First, I downloaded the mnist dataset and extracted all of them and I put the extracted files in the data folder. So the data directory is like this:

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

and inside these folders, there are the related mnist binary file.

So after that, I wanted to test the model with command:

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

However, I am receiving this error:

{'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'

I am running the command prompt as administrator but it didn't work.

I have also checked the permission with right clicking on the folder/file and going to the "security" tab and checking permission. Every thing seemed fine.

So far, I was not able to solve it by looking for previous questions.

I am using Windows 8 and I am running the code via a coda environment.

I appreciate any help regarding this issue.

1
I'd say that you've got an unescaped backslash issue: ` './data\mnist\train-images-idx3 -ubyte'` at least for the tabulation char.Jean-François Fabre♦
sotrrry I did not understand. can you please explain more? @jeaKadaj13
sorry I did not understand very well. can you please explai n more? @jean-FrancoisFabreKadaj13

1 Answers

3
votes

I was able to solve this problem with the following solution:

Actually, this code is written to be used in Linux. However, my platform was Windows. In the "model.py" script and in the load_mnist() function, the code for loading data was data_dir = os.path.join("./data", self.dataset_name)

However, in Windows, you can not access to the current directory by "./" code. So I changed this line to the following lines:

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')

After that, in the source code there was this line:

fd = open(os.path.join(data_dir,'train-images-idx3-ubyte'))

which was trying to open the directory. So I changed it to this one: `fd = open(os.path.join(data_dir,'train-images.idx3-ubyte'), "r+")

Now it worked for me. The thing is that this code was guaranteed to work, except from the windows part, it was trying to open the directory note the file itself. I hope this can help other people as well. `