Giter VIP home page Giter VIP logo

damo-streamnet's People

Contributors

lichenyang-github avatar zhiqic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

damo-streamnet's Issues

ValueError: Attempting to unscale FP16 gradients.

hi您好,我在运行run_train.sh不用预训练模型时遇到了下面的问题,请问可以如何解决?

RuntimeError: expected scalar type Half but found Float

具体报错在这一行
https://github.com/zhiqic/DAMO-StreamNet/blob/adf65eda4308f570dd4d3613c1bcb9f3a4afa7f8/exps/model/damo_yolo/base_models/core/ops.py#L194

经debug发现, self.conv1 的模型weight参数为float32,所以输入fp16会不匹配。

于是在 https://github.com/zhiqic/DAMO-StreamNet/blob/adf65eda4308f570dd4d3613c1bcb9f3a4afa7f8/exps/train_utils/longshort_trainer.py#L142 下一行加了修改模型为半精度即 model = model.half()

但是self.scaler.step(self.optimizer)这句报错ValueError: Attempting to unscale FP16 gradients.

还有在最开始使用预训练模型时也有报错:

File "/home/qtt/Test/DAMO-StreamNet/exps/train_utils/longshort_trainer.py", line 325, in resume_train
ckpt = torch.load(ckpt_file, map_location=self.device)["model"]
│ │ │ │ └ 'cuda:0'
│ │ │ └ <exps.train_utils.longshort_trainer.Trainer object at 0x7f2e84e47150>
│ │ └ '/home/qtt/Test/DAMO-StreamNet/models/coco_pretrained_models/yolox_l_drfpn.pth'
│ └ <function load at 0x7f2e86976200>
└ <module 'torch' from '/home/qtt/Software/anaconda3/envs/torch171_py37_cu110/lib/python3.7/site-packages/torch/init.py'>

File "/home/qtt/Software/anaconda3/envs/torch171_py37_cu110/lib/python3.7/site-packages/torch/serialization.py", line 594, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
│ │ │ │ └ {'encoding': 'utf-8'}
│ │ │ └ <module 'pickle' from '/home/qtt/Software/anaconda3/envs/torch171_py37_cu110/lib/python3.7/pickle.py'>
│ │ └ 'cuda:0'
│ └ <torch._C.PyTorchFileReader object at 0x7f2e84b658b0>
└ <function _load at 0x7f2e86976560>
File "/home/qtt/Software/anaconda3/envs/torch171_py37_cu110/lib/python3.7/site-packages/torch/serialization.py", line 853, in _load
result = unpickler.load()
│ └ <method 'load' of '_pickle.Unpickler' objects>
└ <_pickle.Unpickler object at 0x7f2ddeee84d0>
File "/home/qtt/Software/anaconda3/envs/torch171_py37_cu110/lib/python3.7/site-packages/torch/serialization.py", line 845, in persistent_load
load_tensor(data_type, size, key, _maybe_decode_ascii(location))
│ │ │ │ │ └ 'cuda:0'
│ │ │ │ └ <function _maybe_decode_ascii at 0x7f2e86976440>
│ │ │ └ '94471090091744'
│ │ └ 256
│ └ <class 'torch.FloatStorage'>
└ <function _load..load_tensor at 0x7f2dd8b05cb0>
File "/home/qtt/Software/anaconda3/envs/torch171_py37_cu110/lib/python3.7/site-packages/torch/serialization.py", line 833, in load_tensor
storage = zip_file.get_storage_from_record(name, size, dtype).storage()
│ │ │ │ └ torch.float32
│ │ │ └ 256
│ │ └ 'data/94471090091744'
│ └ <instancemethod get_storage_from_record at 0x7f2e874cb6d0>
└ <torch._C.PyTorchFileReader object at 0x7f2e84b658b0>

RuntimeError: [enforce fail at inline_container.cc:145] . PytorchStreamReader failed reading file data/94471090091744: invalid header or archive is corrupted

环境设置与stream-yolo完全一致,且stream-yolo可以正常运行。
请问下环境设置是否有修改?谢谢!

trainer的区别

请问streamnet_l_1200x1920.py中使用longshort_trainer,但是其他exp使用longshort_dil_trainer,是什么区别呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.