-
Notifications
You must be signed in to change notification settings - Fork 116
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
RuntimeError: context has already been set - Finetuning deepdoctection #313
Comments
In build_train_config_overwrite add the argument ‘use_multi_proc=False’. If you are doing evaluation do the same for ‘build_val_config_overwrite’. Hope, this works. |
Same error when I add use_multi_proc=False : fintabnet = dd.get_dataset("fintabnet") RuntimeError Traceback (most recent call last) File /kaggle/working/deepdoctection/deepdoctection/train/tp_frcnn_train.py:253, in train_faster_rcnn(path_config_yaml, dataset_train, path_weights, config_overwrite, log_dir, build_train_config, dataset_val, build_val_config, metric_name, metric, pipeline_component_name) File /kaggle/working/deepdoctection/deepdoctection/train/tp_frcnn_train.py:136, in get_train_dataflow(dataset, config, use_multi_proc_for_train, **build_train_kwargs) File /kaggle/working/deepdoctection/deepdoctection/utils/file_utils.py:657, in set_mp_spawn() File /opt/conda/lib/python3.10/multiprocessing/context.py:247, in DefaultContext.set_start_method(self, method, force) RuntimeError: context has already been set |
When I add use_multi_proc_for_train=False, I got another error : TypeError Traceback (most recent call last) File /kaggle/working/deepdoctection/deepdoctection/train/tp_frcnn_train.py:253, in train_faster_rcnn(path_config_yaml, dataset_train, path_weights, config_overwrite, log_dir, build_train_config, dataset_val, build_val_config, metric_name, metric, pipeline_component_name) |
Hello,
I am trying to fine-tune deepdoctection tensorpack on fintabnet dataset. I followed instructions on fine-tune notebook but I got this error :
RuntimeError Traceback (most recent call last)
Cell In[140], line 1
----> 1 temp = dd.train_faster_rcnn(path_config_yaml=path_config_yaml,
2 dataset_train=fintabnet,
3 path_weights=path_weights,
4 config_overwrite=config_overwrite,
5 log_dir="/kaggle/working/logs/",
6 build_train_config=build_train_config,
7 dataset_val=dataset_val,
8 build_val_config=build_val_config,
9 metric_name="coco",
10 pipeline_component_name="ImageLayoutService"
11 )
File /kaggle/working/deepdoctection/deepdoctection/train/tp_frcnn_train.py:253, in train_faster_rcnn(path_config_yaml, dataset_train, path_weights, config_overwrite, log_dir, build_train_config, dataset_val, build_val_config, metric_name, metric, pipeline_component_name)
File /kaggle/working/deepdoctection/deepdoctection/train/tp_frcnn_train.py:136, in get_train_dataflow(dataset, config, use_multi_proc_for_train, **build_train_kwargs)
File /kaggle/working/deepdoctection/deepdoctection/utils/file_utils.py:657, in set_mp_spawn()
655 if not _S.mp_context_set:
656 _S.freeze(False)
--> 657 mp.set_start_method("spawn")
658 _S.mp_context_set = True
659 _S.freeze()
File /opt/conda/lib/python3.10/multiprocessing/context.py:247, in DefaultContext.set_start_method(self, method, force)
245 def set_start_method(self, method, force=False):
246 if self._actual_context is not None and not force:
--> 247 raise RuntimeError('context has already been set')
248 if method is None and force:
249 self._actual_context = None
RuntimeError: context has already been set
My code :
temp = dd.train_faster_rcnn(path_config_yaml=path_config_yaml,
dataset_train=fintabnet,
path_weights=path_weights,
config_overwrite=config_overwrite,
log_dir="/kaggle/working/logs/",
build_train_config=build_train_config,
dataset_val=dataset_val,
build_val_config=build_val_config,
metric_name="coco",
pipeline_component_name="ImageLayoutService"
)
Log :
log-3.log
The text was updated successfully, but these errors were encountered: