YOLOF: AttributeError: module 'portalocker' has no attribute 'Lock'
Thanks for sharing your great work. I am sorry that I have a bug when I use
python ./tools/train_net.py --num-gpus 1 --config-file ./configs/yolof_R_50_C5_1x.yaml
Bug log below as :
[03/26 07:38:03 d2.data.build]: Using training sampler TrainingSampler [03/26 07:38:03 d2.data.common]: Serializing 117266 elements to byte tensors and concatenating them all … [03/26 07:38:10 d2.data.common]: Serialized dataset takes 451.21 MiB [03/26 07:38:15 fvcore.common.checkpoint]: Loading checkpoint from detectron2://ImageNetPretrained/MSRA/R-50.pkl Traceback (most recent call last): File “./tools/train_net.py”, line 234, in <module> args=(args,), File “/home/cw/miniconda3/envs/yolof/lib/python3.6/site-packages/detectron2/engine/launch.py”, line 62, in launch main_func(*args) File “./tools/train_net.py”, line 215, in main trainer.resume_or_load(resume=args.resume) File “/home/cw/miniconda3/envs/yolof/lib/python3.6/site-packages/detectron2/engine/defaults.py”, line 353, in resume_or_load checkpoint = self.checkpointer.resume_or_load(self.cfg.MODEL.WEIGHTS, resume=resume) File “/home/cw/miniconda3/envs/yolof/lib/python3.6/site-packages/fvcore/common/checkpoint.py”, line 215, in resume_or_load return self.load(path, checkpointables=[]) File “/home/cw/miniconda3/envs/yolof/lib/python3.6/site-packages/fvcore/common/checkpoint.py”, line 140, in load path = self.path_manager.get_local_path(path) File “/home/cw/miniconda3/envs/yolof/lib/python3.6/site-packages/iopath/common/file_io.py”, line 1100, in get_local_path path, force=force, **kwargs File “/home/cw/miniconda3/envs/yolof/lib/python3.6/site-packages/detectron2/utils/file_io.py”, line 29, in _get_local_path return PathManager.get_local_path(self.S3_DETECTRON2_PREFIX + name, **kwargs) File “/home/cw/miniconda3/envs/yolof/lib/python3.6/site-packages/iopath/common/file_io.py”, line 1100, in get_local_path path, force=force, **kwargs File “/home/cw/miniconda3/envs/yolof/lib/python3.6/site-packages/iopath/common/file_io.py”, line 755, in _get_local_path with file_lock(cached): File “/home/cw/miniconda3/envs/yolof/lib/python3.6/site-packages/iopath/common/file_io.py”, line 82, in file_lock return portalocker.Lock(path + “.lock”, timeout=3600) # type: ignore AttributeError: module ‘portalocker’ has no attribute ‘Lock’
I woule be grateful if you could give me some advice. Thanks.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 31 (10 by maintainers)
first
pip uninstall portalockerandconda install portalockerthen bug will be fixed.另外有一个小地方,我觉得您可以考虑修改下 。 就是您建议安装的
mish-cuda,好像不能够直接 build After git clone,you should movemish-cuda/external/CUDAApplyUtils.cuhtocsrc/beforepython setup.py build installlink-issue
作者您好 我换了一台cuda 10.1的然后重复了我之前的操作,(基本就是直接安装了,数据集也是直接从原来的服务器上传输的)。 然后就没问题了。。。奇葩 我暂时只能归咎于是我之前cuda的9.0,cudatoolkits 9.2不好适配您的代码? (我跑adelaidet还是没问题的,本来大半年没更新了 今天更新了下 简要修改了train.py没啥问题hhh)