tensorflow / models

Models and examples built with TensorFlow
Other
77.21k stars 45.75k forks source link

Context RCNN: TypeError: _compute_second_stage_input_feature_maps() missing 2 required positional arguments: 'context_features' and 'valid_context_size' #9367

Closed george14georgiou closed 4 years ago

george14georgiou commented 4 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/tree/master/official/... and training via Google Collab

2. Describe the bug

During last training step , i have this error from faster_rcnn_meta_arch.py: TypeError: _compute_second_stage_input_feature_maps() missing 2 required positional arguments: 'context_features' and 'valid_context_size'

3. Steps to reproduce

followed the steps from the link given : https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/context_rcnn.md

4. Expected behavior

I expected to training phase to finish without error

5. Additional context

Include any logs that would be helpful to diagnose the problem.

6. System information

ravikyram commented 4 years ago

@george14georgiou

Can you please refer the below tutorial and see if it helps you.Thanks!

george14georgiou commented 4 years ago

I’ve seen this tutorial and run it with my images many times. I understand the variables “valid_context_size” and “context_features”. I don’t understand why the meta architecture cant read them from my tf.Example records. Thank you in advance, George

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: ravikyrammailto:notifications@github.com Sent: Monday, October 12, 2020 3:17 PM To: tensorflow/modelsmailto:models@noreply.github.com Cc: george14georgioumailto:georick14@hotmail.com; Mentionmailto:mention@noreply.github.com Subject: Re: [tensorflow/models] Context RCNN: TypeError: _compute_second_stage_input_feature_maps() missing 2 required positional arguments: 'context_features' and 'valid_context_size' (#9367)

@george14georgiouhttps://github.com/george14georgiou

Can you please refer the below tutorialhttps://notebook.community/tombstone/models/research/object_detection/colab_tutorials/context_rcnn_tutorial and see if it helps you.Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/tensorflow/models/issues/9367#issuecomment-707084764, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQWRRQQGQRNXR2EVPOQO5M3SKLXWHANCNFSM4SMWU5XA.

george14georgiou commented 4 years ago

I found the problem , it was actually in my config file

google-ml-butler[bot] commented 4 years ago

Are you satisfied with the resolution of your issue? Yes No

sulata2 commented 4 years ago

I found the problem , it was actually in my config file

can you please let me know what you changed in config file. because i am also facing same issue.

george14georgiou commented 4 years ago

I changed the entire config file with the suggested one: models\research\object_detection\test_data\context_rcnn_camera_trap.config , and updated all the paths.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: sulata2mailto:notifications@github.com Sent: Wednesday, October 14, 2020 5:30 PM To: tensorflow/modelsmailto:models@noreply.github.com Cc: george14georgioumailto:georick14@hotmail.com; State changemailto:state_change@noreply.github.com Subject: Re: [tensorflow/models] Context RCNN: TypeError: _compute_second_stage_input_feature_maps() missing 2 required positional arguments: 'context_features' and 'valid_context_size' (#9367)

I found the problem , it was actually in my config file

can you please let me know what you changed in config file. because i am also facing same issue.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/tensorflow/models/issues/9367#issuecomment-708441583, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQWRRQTZ7ICCF7COC6SOZADSKWYWTANCNFSM4SMWU5XA.

sulata2 commented 4 years ago

I changed the entire config file with the suggested one: models\research\object_detection\test_data\context_rcnn_camera_trap.config ,

Thank you for your reply. Did you try with your own custom data or you tried with below test data (having 5 test images ) /content/models/research/object_detection/test_images/snapshot_serengeti/context_rcnn_demo_metadata.json . ?

you followed this link https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/context_rcnn.md#generating-tfrecords-from-a-set-of-images-and-a-coco-cameratraps-style-json ?

sulata2 commented 4 years ago

I changed the entire config file with the suggested one: models\research\object_detection\test_data\context_rcnn_camera_trap.config , and updated all the paths. Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10 From: sulata2mailto:notifications@github.com Sent: Wednesday, October 14, 2020 5:30 PM To: tensorflow/modelsmailto:models@noreply.github.com Cc: george14georgioumailto:georick14@hotmail.com; State changemailto:state_change@noreply.github.com Subject: Re: [tensorflow/models] Context RCNN: TypeError: _compute_second_stage_input_feature_maps() missing 2 required positional arguments: 'context_features' and 'valid_context_size' (#9367) I found the problem , it was actually in my config file can you please let me know what you changed in config file. because i am also facing same issue. — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub<#9367 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQWRRQTZ7ICCF7COC6SOZADSKWYWTANCNFSM4SMWU5XA.

Thank you for your reply. Did you try with your own custom data or you tried with below test data (having 5 test images ) /content/models/research/object_detection/test_images/snapshot_serengeti/context_rcnn_demo_metadata.json . ?

you followed this link https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/context_rcnn.md#generating-tfrecords-from-a-set-of-images-and-a-coco-cameratraps-style-json ?

george14georgiou commented 4 years ago

I followed the link but with my data . I did a check to see if my json file is legit and it was.. Though when the training comes to an end I have this error :” Value_Error: Please make sure context_features and valide_context_size are in the features” which comes from the context rcnn meta arch

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: sulata2mailto:notifications@github.com Sent: Thursday, October 15, 2020 2:18 PM To: tensorflow/modelsmailto:models@noreply.github.com Cc: george14georgioumailto:georick14@hotmail.com; State changemailto:state_change@noreply.github.com Subject: Re: [tensorflow/models] Context RCNN: TypeError: _compute_second_stage_input_feature_maps() missing 2 required positional arguments: 'context_features' and 'valid_context_size' (#9367)

I changed the entire config file with the suggested one: models\research\object_detection\test_data\context_rcnn_camera_trap.config , and updated all the paths. Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10 From: sulata2mailto:notifications@github.com Sent: Wednesday, October 14, 2020 5:30 PM To: tensorflow/modelsmailto:models@noreply.github.com Cc: george14georgioumailto:georick14@hotmail.com; State changemailto:state_change@noreply.github.com Subject: Re: [tensorflow/models] Context RCNN: TypeError: _compute_second_stage_input_feature_maps() missing 2 required positional arguments: 'context_features' and 'valid_context_size' (#9367https://github.com/tensorflow/models/issues/9367) I found the problem , it was actually in my config file can you please let me know what you changed in config file. because i am also facing same issue. — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub<#9367 (comment)https://github.com/tensorflow/models/issues/9367#issuecomment-708441583>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQWRRQTZ7ICCF7COC6SOZADSKWYWTANCNFSM4SMWU5XA.

Thank you for your reply. Did you try with your own custom data or you tried with below test data (having 5 test images ) /content/models/research/object_detection/test_images/snapshot_serengeti/context_rcnn_demo_metadata.json . ?

you followed this link https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/context_rcnn.md#generating-tfrecords-from-a-set-of-images-and-a-coco-cameratraps-style-json ?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/tensorflow/models/issues/9367#issuecomment-709211640, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQWRRQWLHVAFS3LWNT4AUG3SK3LA5ANCNFSM4SMWU5XA.

sulata2 commented 4 years ago

I followed the link but with my data . I did a check to see if my json file is legit and it was.. Though when the training comes to an end I have this error :” Value_Error: Please make sure context_features and valide_context_size are in the features” which comes from the context rcnn meta arch Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10 From: sulata2mailto:notifications@github.com Sent: Thursday, October 15, 2020 2:18 PM To: tensorflow/modelsmailto:models@noreply.github.com Cc: george14georgioumailto:georick14@hotmail.com; State changemailto:state_change@noreply.github.com Subject: Re: [tensorflow/models] Context RCNN: TypeError: _compute_second_stage_input_feature_maps() missing 2 required positional arguments: 'context_features' and 'valid_context_size' (#9367) I changed the entire config file with the suggested one: models\research\object_detection\test_data\context_rcnn_camera_trap.config , and updated all the paths. Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10 From: sulata2mailto:notifications@github.com Sent: Wednesday, October 14, 2020 5:30 PM To: tensorflow/modelsmailto:models@noreply.github.com Cc: george14georgioumailto:georick14@hotmail.com; State changemailto:state_change@noreply.github.com Subject: Re: [tensorflow/models] Context RCNN: TypeError: _compute_second_stage_input_feature_maps() missing 2 required positional arguments: 'context_features' and 'valid_context_size' (#9367<#9367>) I found the problem , it was actually in my config file can you please let me know what you changed in config file. because i am also facing same issue. — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub<#9367 (comment)<#9367 (comment)>>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQWRRQTZ7ICCF7COC6SOZADSKWYWTANCNFSM4SMWU5XA. Thank you for your reply. Did you try with your own custom data or you tried with below test data (having 5 test images ) /content/models/research/object_detection/test_images/snapshot_serengeti/context_rcnn_demo_metadata.json . ? you followed this link https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/context_rcnn.md#generating-tfrecords-from-a-set-of-images-and-a-coco-cameratraps-style-json ? — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub<#9367 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQWRRQWLHVAFS3LWNT4AUG3SK3LA5ANCNFSM4SMWU5XA.

even the same error i am getting durring training even though i am using the same config file only. but the issue this conext rcnn accepting only coco cameratrap json format . but json file i got from cvat in coco 1.0 format . what you did to get the correct tfrecord ?

vairaprakashmca commented 4 years ago

during the training I got the following error:

Please switch to tf.train.create_global_step Traceback (most recent call last): File "/content/models/research/object_detection/legacy/train.py", line 186, in tf.app.run() File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 300, in run _run_main(main, args) File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/util/deprecation.py", line 324, in new_func return func(*args, **kwargs) File "/content/models/research/object_detection/legacy/train.py", line 182, in main graph_hook_fn=graph_rewriter_fn) File "/content/models/research/object_detection/legacy/trainer.py", line 279, in train train_config.prefetch_queue_capacity, data_augmentation_options) File "/content/models/research/object_detection/legacy/trainer.py", line 58, in create_input_queue tensor_dict = create_tensor_dict_fn() File "/content/models/research/object_detection/legacy/train.py", line 123, in get_next dataset_builder.build(config)).get_next() File "/content/models/research/object_detection/builders/dataset_builder.py", line 195, in build decoder = decoder_builder.build(input_reader_config) File "/content/models/research/object_detection/builders/decoder_builder.py", line 68, in build load_context_features=input_reader_config.load_context_features) File "/content/models/research/object_detection/data_decoders/tf_sequence_example_decoder.py", line 193, in init 'region/label/string', label_map_proto_file, default_value='') File "/content/models/research/object_detection/data_decoders/tf_sequence_example_decoder.py", line 67, in init label_map_proto_file, use_display_name=False) File "/content/models/research/object_detection/utils/label_map_util.py", line 189, in get_label_map_dict label_map = load_labelmap(label_map_path_or_proto) File "/content/models/research/object_detection/utils/label_map_util.py", line 156, in load_labelmap label_map_string = fid.read() File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/lib/io/file_io.py", line 128, in read pywrap_tensorflow.ReadFromStream(self._read_buf, length)) File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/lib/io/file_io.py", line 98, in _prepare_value return compat.as_str_any(val) File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/util/compat.py", line 123, in as_str_any return as_str(value) File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/util/compat.py", line 93, in as_text return bytes_or_text.decode(encoding) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd9 in position 0: invalid continuation byte

Any idea for the above error. I used tfrecord