Closed DharunBoominathan closed 6 months ago
if you want to use multiple process at the same time, I recommend you to use the threading
python library or other similar one
if you really need to have multiple process you could use pathos
library or subprocess or multiprocessing (keep in mind that pathos is kind a wrapper of multiprocessing library IIRC)
I can't help you having no context or code about your error
RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in
File "C:\Users\PRADEEP\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\Users\PRADEEP\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 125, in _main
prepare(preparation_data)
File "C:\Users\PRADEEP\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\PRADEEP\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "C:\Users\PRADEEP\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 269, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Users\PRADEEP\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\PRADEEP\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\PRADEEP\Downloads\Car-Model-Recognition-master\Car-Model-Recognition-master\main.py", line 228, in
train_model_iter("resnet152", resnet152_model)
File "C:\Users\PRADEEP\Downloads\Car-Model-Recognition-master\Car-Model-Recognition-master\main.py", line 216, in train_model_iter
model, loss_acc, y_testing, preds = train_model(model_name=model_name, model=model, weight_decay=weight_decay)
File "C:\Users\PRADEEP\Downloads\Car-Model-Recognition-master\Car-Model-Recognition-master\main.py", line 122, in train_model
print (batch['img_name'])
UnboundLocalError: local variable 'batch' referenced before assignment