run_dataset报错求助
zhongyouque opened this issue · 5 comments
我在进行测试run_dataset的时候出现了如下错误:
2024-03-12 16:56:24 - FET-Dataset - PID:23124 [DEBUG] Logger initialized.
2024-03-12 16:56:24 - FET-Dataset - PID:23124 [INFO] Extracting features from 'SIMS' dataset.
2024-03-12 16:56:24 - FET-Dataset - PID:23124 [INFO] Dataset directory: 'D:\data\毕设\Self-MM-main\Self-MM-main\datasets\SIMS'
0%| | 0/2281 [00:00<?, ?it/s]2024-03-12 16:56:28 - FET-Dataset - PID:28000 [DEBUG] Logger initialized.
2024-03-12 16:56:28 - FET-Dataset - PID:28000 [INFO] Extracting features from 'SIMS' dataset.
2024-03-12 16:56:28 - FET-Dataset - PID:28000 [INFO] Dataset directory: 'D:\data\毕设\Self-MM-main\Self-MM-main\datasets\SIMS'
2024-03-12 16:56:28 - FET-Dataset - PID:28028 [DEBUG] Logger initialized.
Traceback (most recent call last):
File "C:\program1\python3_11_0_b2\Lib\site-packages\MSA_FET\dataset.py", line 421, in run_dataset
pool = mp_ctx.Pool(
^^^^^^^^^^^^2024-03-12 16:56:28 - FET-Dataset - PID:28000 [ERROR] An Error Occured:
Traceback (most recent call last):
File "C:\program1\python3_11_0_b2\Lib\site-packages\MSA_FET\dataset.py", line 421, in run_dataset
pool = mp_ctx.Pool(
^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\pool.py", line 212, in init
self._repopulate_pool()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
w.start()
^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\popen_spawn_win32.py", line 45, in init
prep_data = spawn.get_preparation_data(process_obj._name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\spawn.py", line 158, in get_preparation_data
_check_not_importing_main()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\spawn.py", line 138, in _check_not_importing_main
raise RuntimeError('''
^^^^^^^^^^^^^^^^^^^^^^
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\pool.py", line 212, in init
self._repopulate_pool()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\pool.py", line 326, in _repopulate_pool_static
w.start()
^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\popen_spawn_win32.py", line 45, in init
prep_data = spawn.get_preparation_data(process_obj._name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\spawn.py", line 158, in get_preparation_data
_check_not_importing_main()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\program1\python3_11_0_b2\Lib\multiprocessing\spawn.py", line 138, in _check_not_importing_main
raise RuntimeError('''
^^^^^^^^^^^^^^^^^^^^^^
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
During handling of the above exception, another exception occurred:
希望能获知原因
同样的错误,请问怎么解决
同样的问题
同样的问题
同样的问题
可以通过以下解决:
if name == 'main':
run_dataset(
config = "aligned",
dataset_dir="./MOSI",
out_file="./feature.pkl",
num_workers=1
)