video_feature_extractor
video_feature_extractor copied to clipboard
Error when runing "python extract.py --csv=input.csv --type=2d --batch_size=64 --num_decoding_thread=1" on windows and linux

python extract.py --csv=input.csv --type=2d --batch_size=64 --num_decoding_thread=1
Loading 2D-ResNet-152 ...
loaded
Loading 2D-ResNet-152 ...
loaded
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\hp\Miniconda3\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\Users\hp\Miniconda3\lib\multiprocessing\spawn.py", line 125, in _main
prepare(preparation_data)
File "C:\Users\hp\Miniconda3\lib\multiprocessing\spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\hp\Miniconda3\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "C:\Users\hp\Miniconda3\lib\runpy.py", line 262, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Users\hp\Miniconda3\lib\runpy.py", line 95, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\hp\Miniconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\论文\视频到视频\video_feature_extractor\extract.py", line 51, in <module>
for k, data in enumerate(loader):
File "C:\Users\hp\Miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 359, in __iter__
return self._get_iterator()
File "C:\Users\hp\Miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 305, in _get_iterator
return _MultiProcessingDataLoaderIter(self)
File "C:\Users\hp\Miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 918, in __init__
w.start()
File "C:\Users\hp\Miniconda3\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Users\hp\Miniconda3\lib\multiprocessing\context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\hp\Miniconda3\lib\multiprocessing\context.py", line 326, in _Popen
return Popen(process_obj)
File "C:\Users\hp\Miniconda3\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\hp\Miniconda3\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "C:\Users\hp\Miniconda3\lib\multiprocessing\spawn.py", line 134, 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.
Traceback (most recent call last):
File "C:\Users\hp\Miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 990, in _try_get_data
data = self._data_queue.get(timeout=timeout)
File "C:\Users\hp\Miniconda3\lib\multiprocessing\queues.py", line 108, in get
raise Empty
_queue.Empty
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "extract.py", line 51, in <module>
for k, data in enumerate(loader):
File "C:\Users\hp\Miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 521, in __next__
data = self._next_data()
File "C:\Users\hp\Miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 1186, in _next_data
idx, data = self._get_data()
File "C:\Users\hp\Miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 1152, in _get_data
success, data = self._try_get_data()
File "C:\Users\hp\Miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 1003, in _try_get_data
raise RuntimeError('DataLoader worker (pid(s) {}) exited unexpectedly'.format(pids_str)) from e
RuntimeError: DataLoader worker (pid(s) 8308) exited unexpectedly
On linux, I run "python extract.py --csv=input.csv --type=2d --batch_size=64 --num_decoding_thread=4", but


On linux, I run "python extract.py --csv=input.csv --type=2d --batch_size=64 --num_decoding_thread=4", but
Traceback (most recent call last):
File "extract.py", line 51, in <module>
for k, data in enumerate(loader):
File "/usr/local/miniconda3/envs/py37torch160/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 530, in __next__
data = self._next_data()
File "/usr/local/miniconda3/envs/py37torch160/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1224, in _next_data
return self._process_data(data)
File "/usr/local/miniconda3/envs/py37torch160/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1250, in _process_data
data.reraise()
File "/usr/local/miniconda3/envs/py37torch160/lib/python3.7/site-packages/torch/_utils.py", line 457, in reraise
raise exception
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/miniconda3/envs/py37torch160/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/miniconda3/envs/py37torch160/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/miniconda3/envs/py37torch160/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/hy-nas/video_feature_extractor/video_loader.py", line 77, in __getitem__
video = np.frombuffer(out, np.uint8).reshape([-1, height, width, 3])
TypeError: a bytes-like object is required, not 'NoneType'