dawei6875797 / Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks

289 stars 107 forks source link

Error when trying to test.py #10

Open aadi0923 opened 5 years ago

aadi0923 commented 5 years ago

FileNotFoundError: [Errno 2] No such file or directory: '/new_disk2/wangzw/tangxu/age_data/train_data/train_age_group_0.txt'

can anyone plzz give exact solution

MaggieMC commented 5 years ago

I have the same problem:

File "test.py", line 54, in shuffle=False, mode='train') File "./tools/data_generator.py", line 54, in init self.read_class_list(self.class_lists) File "./tools/data_generator.py", line 110, in read_class_list f = open(self.file_folder + class_lists[i], 'r') FileNotFoundError: [Errno 2] No such file or directory: '/new_disk2/wangzw/tangxu/age_data/train_data/train_age_group_0.txt'

MaggieMC commented 5 years ago

@adityacodezilla Hi, I managed to get this working.

  1. Comment out line 54 in tools/data_generator.py: ( self.read_class_list(self.class_lists) )
  2. in test.py lines 96 and 101 change load_test_imgs function to load_imgs This should work
aadi0923 commented 5 years ago

Thank you so much @MaggieMC

Ciaoye commented 5 years ago

@adityacodezilla Hi, I managed to get this working.

  1. Comment out line 54 in tools/data_generator.py: ( self.read_class_list(self.class_lists) )
  2. in test.py lines 96 and 101 change load_test_imgs function to load_imgs This should work

Hi! I got new error said 'Nonetype' object is not subscritable

amlan086 commented 5 years ago

@adityacodezilla Hi, I managed to get this working.

  1. Comment out line 54 in tools/data_generator.py: ( self.read_class_list(self.class_lists) )
  2. in test.py lines 96 and 101 change load_test_imgs function to load_imgs This should work

Traceback (most recent call last): File "test.py", line 167, in tf.app.run() File "C:\Users\Asus\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "test.py", line 163, in main my_train() File "test.py", line 95, in my_train generate_images_from_folder(model, sess, FLAGS.test_data_dir, FLAGS.train_data_dir) File "test.py", line 99, in generate_images_from_folder source, paths = val_generator.load_imgs(test_data_dir, 128) File "./tools\data_generator.py", line 317, in load_imgs img = img[:, :, [2, 1, 0]] TypeError: 'NoneType' object is not subscriptable

I got this error

ayi-afk commented 5 years ago

Hey @amlan086 @naliece about that NoneType 2 things first rename/delete /images/17_zo{HERE SOME UNICODE SH***}Kravitz ...

and in data_generator.py [after changes that @adityacodezilla proposed]

Joyce1213 commented 5 years ago

@adityacodezilla Hi, I managed to get this working.

  1. Comment out line 54 in tools/data_generator.py: ( self.read_class_list(self.class_lists) )
  2. in test.py lines 96 and 101 change load_test_imgs function to load_imgs This should work

Traceback (most recent call last): File "test.py", line 167, in tf.app.run() File "C:\Users\Asus\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "test.py", line 163, in main my_train() File "test.py", line 95, in my_train generate_images_from_folder(model, sess, FLAGS.test_data_dir, FLAGS.train_data_dir) File "test.py", line 99, in generate_images_from_folder source, paths = val_generator.load_imgs(test_data_dir, 128) File "./tools\data_generator.py", line 317, in load_imgs img = img[:, :, [2, 1, 0]] TypeError: 'NoneType' object is not subscriptable

I got this error

hello I also got this error? Have you solved this error?

nalibjchn commented 5 years ago

@adityacodezilla Hi, I managed to get this working.

  1. Comment out line 54 in tools/data_generator.py: ( self.read_class_list(self.class_lists) )
  2. in test.py lines 96 and 101 change load_test_imgs function to load_imgs This should work

Traceback (most recent call last): File "test.py", line 167, in tf.app.run() File "C:\Users\Asus\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "test.py", line 163, in main my_train() File "test.py", line 95, in my_train generate_images_from_folder(model, sess, FLAGS.test_data_dir, FLAGS.train_data_dir) File "test.py", line 99, in generate_images_from_folder source, paths = val_generator.load_imgs(test_data_dir, 128) File "./tools\data_generator.py", line 317, in load_imgs img = img[:, :, [2, 1, 0]] TypeError: 'NoneType' object is not subscriptable

I got this error

Hi I also got this error, can you fix it now?

ninja18 commented 5 years ago

@lindalibjchn @Joyce1213 @amlan086

The problem is due to hidden . extension files in the test or train directory. In my case OSX creates .DS_Store file in the test folder. So we have to start the loop from index 1 not 0. change these lines

[data_generator.py line 315] for i in range(len(paths)): to for i in range(1,len(paths)):

and

[test.py line 107] for i in range(len(paths)): to for i in range(1,len(paths)):

discreterandomvariable commented 5 years ago

@adityacodezilla Hi, I managed to get this working.

  1. Comment out line 54 in tools/data_generator.py: ( self.read_class_list(self.class_lists) )
  2. in test.py lines 96 and 101 change load_test_imgs function to load_imgs This should work

Hi I did this and I am now getting the below error, kindly assist. The specified file path exists but still it says system not able to find specified path.

2019-07-30 11:57:58.407139: W T:\src\github\tensorflow\tensorflow\core\framework\op_kernel.cc:1318] OP_REQUIRES failed at save_restore_v2_ops.cc:184 : Not found: Can not get size for: checkpoints/0_conv5_lsgan_transfer_g75_0.5f-4_a30/acgan.model-399999.index : The system cannot find the path specified. ; No such process Traceback (most recent call last): File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1322, in _do_call return fn(*args) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1307, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1409, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.NotFoundError: Can not get size for: checkpoints/0_conv5_lsgan_transfer_g75_0.5f-4_a30/acgan.model-399999.index : The system cannot find the path specified. ; No such process [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:/Users/akshay_l/Desktop/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 165, in tf.app.run() File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "C:/Users/akshay_l/Desktop/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 161, in main my_train() File "C:/Users/akshay_l/Desktop/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 82, in my_train if model.load(FLAGS.checkpoint_dir, model.saver, 'acgan', 399999): File "C:\Users\akshay_l\Desktop\Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master\Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master\models.py", line 377, in load saver.restore(self.sess, os.path.join(checkpoint_dir, ckpt_name)) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1768, in restore six.reraise(exception_type, exception_value, exception_traceback) File "C:\ProgramFiles\Anaconda3\lib\site-packages\six.py", line 693, in reraise raise value File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1752, in restore {self.saver_def.filename_tensor_name: save_path}) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 900, in run run_metadata_ptr) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1135, in _run feed_dict_tensor, options, run_metadata) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1316, in _do_run run_metadata) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1335, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.NotFoundError: Can not get size for: checkpoints/0_conv5_lsgan_transfer_g75_0.5f-4_a30/acgan.model-399999.index : The system cannot find the path specified. ; No such process [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

Caused by op 'save/RestoreV2', defined at: File "C:/Users/akshay_l/Desktop/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 165, in tf.app.run() File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "C:/Users/akshay_l/Desktop/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 161, in main my_train() File "C:/Users/akshay_l/Desktop/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 77, in my_train model.saver = tf.train.Saver(model.save_g_vars) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1284, in init self.build() File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1296, in build self._build(self._filename, build_save=True, build_restore=True) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1333, in _build build_save=build_save, build_restore=build_restore) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 781, in _build_internal restore_sequentially, reshape) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 400, in _AddRestoreOps restore_sequentially) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 832, in bulk_restore return io_ops.restore_v2(filename_tensor, names, slices, dtypes) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 1546, in restore_v2 shape_and_slices=shape_and_slices, dtypes=dtypes, name=name) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3414, in create_op op_def=op_def) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1740, in init self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

NotFoundError (see above for traceback): Can not get size for: checkpoints/0_conv5_lsgan_transfer_g75_0.5f-4_a30/acgan.model-399999.index : The system cannot find the path specified. ; No such process [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

nalibjchn commented 5 years ago

@adityacodezilla Hi, me managed to get this working.

  1. Comment out line 54 in tools/data_generator.py: ( self.read_class_list(self.class_lists) )
  2. in test.py lines 96 and 101 change load_test_imgs function to load_imgs dis should work

Hi I did this and I am now getting the below error, kindly assist. The specified file path exists but still it says system not able to find specified path.

2019-07-30 11:57:58.407139: W T:\src\github\tensorflow\tensorflow\core\framework\op_kernel.cc:1318] OP_REQUIRES failed at save_restore_v2_ops.cc:184 : Not found: Can not get size for: checkpoints/0_conv5_lsgan_transfer_g75_0.5f-4_a30/acgan.model-399999.index : Teh system cannot find teh path specified. ; No such process Traceback (most recent call last): File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1322, in _do_call return fn(*args) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1307, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1409, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.NotFoundError: Can not get size for: checkpoints/0_conv5_lsgan_transfer_g75_0.5f-4_a30/acgan.model-399999.index : The system cannot find the path specified. ; No such process [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

During handling of teh above exception, another exception occurred:

Traceback (most recent call last): File "C:/Users/akshay_l/Desktop/Face-Aging-wif-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-wif-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 165, in tf.app.run() File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "C:/Users/akshay_l/Desktop/Face-Aging-wif-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-wif-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 161, in main my_train() File "C:/Users/akshay_l/Desktop/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 82, in my_train if model.load(FLAGS.checkpoint_dir, model.saver, 'acgan', 399999): File "C:\Users\akshay_l\Desktop\Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master\Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master\models.py", line 377, in load saver.restore(self.sess, os.path.join(checkpoint_dir, ckpt_name)) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1768, in restore six.reraise(exception_type, exception_value, exception_traceback) File "C:\ProgramFiles\Anaconda3\lib\site-packages\six.py", line 693, in reraise raise value File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1752, in restore {self.saver_def.filename_tensor_name: save_path}) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 900, in run run_metadata_ptr) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1135, in _run feed_dict_tensor, options, run_metadata) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1316, in _do_run run_metadata) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1335, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.NotFoundError: Can not get size for: checkpoints/0_conv5_lsgan_transfer_g75_0.5f-4_a30/acgan.model-399999.index : Teh system cannot find teh path specified. ; No such process [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

Caused by op 'save/RestoreV2', defined at: File "C:/Users/akshay_l/Desktop/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 165, in tf.app.run() File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "C:/Users/akshay_l/Desktop/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-with-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 161, in main my_train() File "C:/Users/akshay_l/Desktop/Face-Aging-wif-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/Face-Aging-wif-Identity-Preserved-Conditional-Generative-Adversarial-Networks-master/test.py", line 77, in my_train model.saver = tf.train.Saver(model.save_g_vars) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1284, in init self.build() File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1296, in build self._build(self._filename, build_save=True, build_restore=True) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1333, in _build build_save=build_save, build_restore=build_restore) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 781, in _build_internal restore_sequentially, reshape) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 400, in _AddRestoreOps restore_sequentially) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 832, in bulk_restore return io_ops.restore_v2(filename_tensor, names, slices, dtypes) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 1546, in restore_v2 shape_and_slices=shape_and_slices, dtypes=dtypes, name=name) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_halper op_def=op_def) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3414, in create_op op_def=op_def) File "C:\ProgramFiles\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1740, in init self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

NotFoundError (see above for traceback): Can not get size for: checkpoints/0_conv5_lsgan_transfer_g75_0.5f-4_a30/acgan.model-399999.index : Teh system cannot find teh path specified. ; No such process [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

you have to solve this simple issue at first: NotFoundError (see above for traceback): Can not get size for: checkpoints/0_conv5_lsgan_transfer_g75_0.5f-4_a30/acgan.model-399999.index : Teh system cannot find teh path specified. ; No such process

hbxce123 commented 4 years ago

How to generate the label file named 'train_age_group_0.txt'