Кажется, я получаю сообщение об ошибке при вызове метода перечисления pytorch. Из-за поиска в Google только сообщения об ошибке, похоже, проблема с моей операционной системой, macOS catalina. Есть ли решение, которое я просто не смог найти, и / или есть альтернатива использованию enumerate? (Я запускаю сценарии, написанные кем-то другим, и я не знаком с DataLoaders в pytorch и не могу найти много информации о методе перечисления). Вот полное сообщение об ошибке:
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Couldn't close file
Traceback (most recent call last):
File "background_analysis.py", line 313, in <module>
validation_classifier(fit_tree, "../events/" + data + "/dataframes/bbbb_SR.h5", data_name=data, method_name=method, region='SR', epochs=15)
File "/Users/Trevor/Desktop/Research/toy4b/python/validation.py", line 18, in validation_classifier
model.runEpoch(print_all_epochs=True, fit_validation=True, data_name=data_name, method_name=method_name, region=region)
File "fvt_scripts/model_train.py", line 1270, in runEpoch
self.validate()
File "fvt_scripts/model_train.py", line 1132, in validate
self.evaluate(self.validation, doROC)
File "fvt_scripts/model_train.py", line 1111, in evaluate
for i, (J, O, D, Q, y, w) in enumerate(results.evalLoader):
File "/Users/Trevor/Desktop/Research/myenv/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 279, in __iter__
return _MultiProcessingDataLoaderIter(self)
File "/Users/Trevor/Desktop/Research/myenv/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 746, in __init__
self._try_put_index()
File "/Users/Trevor/Desktop/Research/myenv/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 861, in _try_put_index
index = self._next_index()
File "/Users/Trevor/Desktop/Research/myenv/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 339, in _next_index
return next(self._sampler_iter) # may raise StopIteration
File "/Users/Trevor/Desktop/Research/myenv/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 202, in __iter__
if len(batch) == self.batch_size:
File "/Users/Trevor/Desktop/Research/myenv/lib/python3.7/site-packages/torch/utils/data/_utils/signal_handling.py", line 66, in handler
_error_if_any_worker_fails()
RuntimeError: DataLoader worker (pid 6750) is killed by signal: Unknown signal: 0.
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Couldn't close file
Abort trap: 6