Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'j' is not defined #364

Open
Leontree opened this issue Sep 17, 2019 · 2 comments
Open

NameError: name 'j' is not defined #364

Leontree opened this issue Sep 17, 2019 · 2 comments

Comments

@Leontree
Copy link

Leontree commented Sep 17, 2019

D:\DCGAN-tensorflow-master\DCGAN-tensorflow-master>python main.py --dataset img --input_height=765 --output_height=765 --train
{'G_img_sum': <absl.flags._flag.BooleanFlag object at 0x0000023496289390>,
'batch_size': <absl.flags._flag.Flag object at 0x00000234909DFBA8>,
'beta1': <absl.flags._flag.Flag object at 0x00000234930F2EB8>,
'checkpoint_dir': <absl.flags._flag.Flag object at 0x000002349627FD30>,
'ckpt_freq': <absl.flags._flag.Flag object at 0x0000023496289208>,
'crop': <absl.flags._flag.BooleanFlag object at 0x000002349627FE80>,
'data_dir': <absl.flags._flag.Flag object at 0x000002349627FB70>,
'dataset': <absl.flags._flag.Flag object at 0x000002349627FA58>,
'epoch': <absl.flags._flag.Flag object at 0x000002348CCF6748>,
'export': <absl.flags._flag.BooleanFlag object at 0x000002349627FF60>,
'freeze': <absl.flags._flag.BooleanFlag object at 0x000002349627FFD0>,
'h': <tensorflow.python.platform.app._HelpFlag object at 0x0000023496289400>,
'help': <tensorflow.python.platform.app._HelpFlag object at 0x0000023496289400>,
'helpfull': <tensorflow.python.platform.app._HelpfullFlag object at 0x0000023496289470>,
'helpshort': <tensorflow.python.platform.app._HelpshortFlag object at 0x00000234962894E0>,
'input_fname_pattern': <absl.flags._flag.Flag object at 0x000002349627FAC8>,
'input_height': <absl.flags._flag.Flag object at 0x00000234932BE748>,
'input_width': <absl.flags._flag.Flag object at 0x000002349627F940>,
'learning_rate': <absl.flags._flag.Flag object at 0x000002348DA8D860>,
'max_to_keep': <absl.flags._flag.Flag object at 0x00000234962890B8>,
'out_dir': <absl.flags._flag.Flag object at 0x000002349627FBE0>,
'out_name': <absl.flags._flag.Flag object at 0x000002349627FC88>,
'output_height': <absl.flags._flag.Flag object at 0x000002349627F898>,
'output_width': <absl.flags._flag.Flag object at 0x000002349627F9E8>,
'sample_dir': <absl.flags._flag.Flag object at 0x000002349627FDA0>,
'sample_freq': <absl.flags._flag.Flag object at 0x0000023496289160>,
'train': <absl.flags._flag.BooleanFlag object at 0x000002349627FDD8>,
'train_size': <absl.flags._flag.Flag object at 0x00000234930FB748>,
'visualize': <absl.flags._flag.BooleanFlag object at 0x000002349627FEF0>,
'z_dim': <absl.flags._flag.Flag object at 0x00000234962892B0>,
'z_dist': <absl.flags._flag.Flag object at 0x0000023496289358>}
2019-09-18 06:15:20.855231: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

Variables: name (type shape) [size]

generator/g_h0_lin/Matrix:0 (float32_ref 100x1179648) [117964800, bytes: 471859200]
generator/g_h0_lin/bias:0 (float32_ref 1179648) [1179648, bytes: 4718592]
generator/g_bn0/beta:0 (float32_ref 512) [512, bytes: 2048]
generator/g_bn0/gamma:0 (float32_ref 512) [512, bytes: 2048]
generator/g_h1/w:0 (float32_ref 5x5x256x512) [3276800, bytes: 13107200]
generator/g_h1/biases:0 (float32_ref 256) [256, bytes: 1024]
generator/g_bn1/beta:0 (float32_ref 256) [256, bytes: 1024]
generator/g_bn1/gamma:0 (float32_ref 256) [256, bytes: 1024]
generator/g_h2/w:0 (float32_ref 5x5x128x256) [819200, bytes: 3276800]
generator/g_h2/biases:0 (float32_ref 128) [128, bytes: 512]
generator/g_bn2/beta:0 (float32_ref 128) [128, bytes: 512]
generator/g_bn2/gamma:0 (float32_ref 128) [128, bytes: 512]
generator/g_h3/w:0 (float32_ref 5x5x64x128) [204800, bytes: 819200]
generator/g_h3/biases:0 (float32_ref 64) [64, bytes: 256]
generator/g_bn3/beta:0 (float32_ref 64) [64, bytes: 256]
generator/g_bn3/gamma:0 (float32_ref 64) [64, bytes: 256]
generator/g_h4/w:0 (float32_ref 5x5x3x64) [4800, bytes: 19200]
generator/g_h4/biases:0 (float32_ref 3) [3, bytes: 12]
discriminator/d_h0_conv/w:0 (float32_ref 5x5x3x64) [4800, bytes: 19200]
discriminator/d_h0_conv/biases:0 (float32_ref 64) [64, bytes: 256]
discriminator/d_h1_conv/w:0 (float32_ref 5x5x64x128) [204800, bytes: 819200]
discriminator/d_h1_conv/biases:0 (float32_ref 128) [128, bytes: 512]
discriminator/d_bn1/beta:0 (float32_ref 128) [128, bytes: 512]
discriminator/d_bn1/gamma:0 (float32_ref 128) [128, bytes: 512]
discriminator/d_h2_conv/w:0 (float32_ref 5x5x128x256) [819200, bytes: 3276800]
discriminator/d_h2_conv/biases:0 (float32_ref 256) [256, bytes: 1024]
discriminator/d_bn2/beta:0 (float32_ref 256) [256, bytes: 1024]
discriminator/d_bn2/gamma:0 (float32_ref 256) [256, bytes: 1024]
discriminator/d_h3_conv/w:0 (float32_ref 5x5x256x512) [3276800, bytes: 13107200]
discriminator/d_h3_conv/biases:0 (float32_ref 512) [512, bytes: 2048]
discriminator/d_bn3/beta:0 (float32_ref 512) [512, bytes: 2048]
discriminator/d_bn3/gamma:0 (float32_ref 512) [512, bytes: 2048]
discriminator/d_h4_lin/Matrix:0 (float32_ref 1179648x1) [1179648, bytes: 4718592]
discriminator/d_h4_lin/bias:0 (float32_ref 1) [1, bytes: 4]
Total size of variables: 128940420
Total bytes of variables: 515761680
2019-09-18 06:15:22.676660: W tensorflow/core/framework/allocator.cc:101] Allocation of 471859200 exceeds 10% of system memory.
2019-09-18 06:15:22.915099: W tensorflow/core/framework/allocator.cc:101] Allocation of 471859200 exceeds 10% of system memory.
2019-09-18 06:15:23.269142: W tensorflow/core/framework/allocator.cc:101] Allocation of 471859200 exceeds 10% of system memory.
2019-09-18 06:15:23.507608: W tensorflow/core/framework/allocator.cc:101] Allocation of 471859200 exceeds 10% of system memory.
2019-09-18 06:15:23.898754: W tensorflow/core/framework/allocator.cc:101] Allocation of 471859200 exceeds 10% of system memory.
2019-09-18 06:15:24.174286: W tensorflow/core/framework/allocator.cc:101] Allocation of 471859200 exceeds 10% of system memory.
2019-09-18 06:15:24.174551: W tensorflow/core/framework/allocator.cc:101] Allocation of 471859200 exceeds 10% of system memory.
2019-09-18 06:15:24.252897: W tensorflow/core/framework/allocator.cc:101] Allocation of 471859200 exceeds 10% of system memory.
2019-09-18 06:15:26.392673: W tensorflow/core/framework/allocator.cc:101] Allocation of 471859200 exceeds 10% of system memory.
Traceback (most recent call last):
File "main.py", line 147, in
tf.app.run()
File "D:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run
_sys.exit(main(argv))
File "main.py", line 120, in main
dcgan.train(FLAGS)
File "D:\DCGAN-tensorflow-master\DCGAN-tensorflow-master\model.py", line 195, in train
grayscale=self.grayscale) for sample_file in sample_files]
File "D:\DCGAN-tensorflow-master\DCGAN-tensorflow-master\model.py", line 195, in
grayscale=self.grayscale) for sample_file in sample_files]
File "D:\DCGAN-tensorflow-master\DCGAN-tensorflow-master\utils.py", line 44, in get_image
resize_height, resize_width, crop)
File "D:\DCGAN-tensorflow-master\DCGAN-tensorflow-master\utils.py", line 104, in transform
im = Image.fromarray(image[j:j+crop_h, i:i+crop_w])
NameError: name 'j' is not defined

HI, can any body help me?

@ben-coo-per
Copy link

I think I may have had the same problem. Check out #366
wflaschka found a solution that fixed my problem.

@osetinsky
Copy link

#366 worked for me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants