yuanqili78 / SED-Net

Surface and Edge Detection for Primitive Fitting of Point Clouds,SIGGRAPH 2023
38 stars 8 forks source link

about pytorch version #6

Open MingFengHill opened 6 months ago

MingFengHill commented 6 months ago

I configured the python environment according to ParSeNet's readme. But when I execute the test code I get the following error:

(parsenet) wang:~/recon/SED-Net$ python generate_predictions_aug.py configs/config_SEDNet_normal.yml NoSave no_multi_vote no_fold5drop
uisng HPNet embeding way!!!!
ori dataset use data aug
start at 0
Traceback (most recent call last):
  File "/home/wang/anaconda3/envs/parsenet/lib/python3.6/tarfile.py", line 189, in nti
    n = int(s.strip() or "0", 8)
ValueError: invalid literal for int() with base 8: 'nsor_v2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wang/anaconda3/envs/parsenet/lib/python3.6/tarfile.py", line 2295, in next
    tarinfo = self.tarinfo.fromtarfile(self)
  File "/home/wang/anaconda3/envs/parsenet/lib/python3.6/tarfile.py", line 1091, in fromtarfile
    obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors)
  File "/home/wang/anaconda3/envs/parsenet/lib/python3.6/tarfile.py", line 1033, in frombuf
    chksum = nti(buf[148:156])
  File "/home/wang/anaconda3/envs/parsenet/lib/python3.6/tarfile.py", line 191, in nti
    raise InvalidHeaderError("invalid header")
tarfile.InvalidHeaderError: invalid header

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wang/anaconda3/envs/parsenet/lib/python3.6/site-packages/torch/serialization.py", line 555, in _load
    return legacy_load(f)
  File "/home/wang/anaconda3/envs/parsenet/lib/python3.6/site-packages/torch/serialization.py", line 466, in legacy_load
    with closing(tarfile.open(fileobj=f, mode='r:', format=tarfile.PAX_FORMAT)) as tar, \
  File "/home/wang/anaconda3/envs/parsenet/lib/python3.6/tarfile.py", line 1587, in open
    return func(name, filemode, fileobj, **kwargs)
  File "/home/wang/anaconda3/envs/parsenet/lib/python3.6/tarfile.py", line 1617, in taropen
    return cls(name, mode, fileobj, **kwargs)
  File "/home/wang/anaconda3/envs/parsenet/lib/python3.6/tarfile.py", line 1480, in __init__
    self.firstmember = self.next()
  File "/home/wang/anaconda3/envs/parsenet/lib/python3.6/tarfile.py", line 2307, in next
    raise ReadError(str(e))
tarfile.ReadError: invalid header

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "generate_predictions_aug.py", line 191, in <module>
    state_dict = torch.load(config.pretrain_model_path)

This seems to be caused by the wrong pytorch version, would it be possible to provide environment.yml

PPzpower commented 6 months ago

我也遇到了这个问题,这个最后的错误是:RuntimeError: ckpts/pretrain_sed_net_InstBest.pth is a zip archive (did you mean to use torch.jit.load()?),好像是预训练模型格式的问题。请问您解决这个问题了吗?

PPzpower commented 6 months ago

这个是pytorch版本的问题。 在pytorch1.6版本下运行: state_dict = torch.load("xxx.pth") torch.save(state_dict, "xxx.pth", _use_new_zipfile_serialization=False) 则将权重文件转换成非zip格式。

MingFengHill commented 6 months ago

这个是pytorch版本的问题。 在pytorch1.6版本下运行: state_dict = torch.load("xxx.pth") torch.save(state_dict, "xxx.pth", _use_new_zipfile_serialization=False) 则将权重文件转换成非zip格式。

Thanks, it works.