Giter Club home page Giter Club logo

Comments (4)

DotWang avatar DotWang commented on May 24, 2024

@AnRanbel please show the whole error report

from rsp.

AnRanbel avatar AnRanbel commented on May 24, 2024

@AnRanbel please show the whole error report

谢谢你的回复,我有将你们的代码移植到最新版的mmsegmentation里面,所以有些路径可能不同,但我训练和测试过了,除了不设置pretrained的时候会报错,其他都是正常运行的。

Exception has occurred: AttributeError (note: full exception trace is shown but execution is paused at: _run_module_as_main)
'ViTAE_Window_NoShift_basic' object has no attribute 'use_abs_pos_embed'
File "/root/miniconda3/envs/mmyolo/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
File "/root/autodl-tmp/mmsegmentation/mmseg/models/backbones/ViTAE_Window_NoShift/base_model.py", line 197, in init_weights
if self.use_abs_pos_embed:
File "/root/miniconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/model/base_module.py", line 130, in init_weights
m.init_weights()
File "/root/miniconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/runner/runner.py", line 899, in _init_model_weights
model.init_weights()
File "/root/miniconda3/envs/mmyolo/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1707, in train
self._init_model_weights()
File "/root/autodl-tmp/mmsegmentation/tools/train.py", line 134, in main
runner.train()
File "/root/autodl-tmp/mmsegmentation/tools/train.py", line 138, in
main()
File "/root/miniconda3/envs/mmyolo/lib/python3.8/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/root/miniconda3/envs/mmyolo/lib/python3.8/runpy.py", line 192, in _run_module_as_main (Current frame)
return _run_code(code, main_globals, None,
AttributeError: 'ViTAE_Window_NoShift_basic' object has no attribute 'use_abs_pos_embed'

from rsp.

DotWang avatar DotWang commented on May 24, 2024

@AnRanbel ViTAEv2中没有绝对位置编码,这段加载权重的代码可能是从什么地方直接复制过来的,当时没考虑不加载权重的情况,所以pretrained=None的时候,你把它注释掉

# if self.use_abs_pos_embed:
#    trunc_normal_(self.absolute_pos_embed, std=0.02)

from rsp.

AnRanbel avatar AnRanbel commented on May 24, 2024

@AnRanbel ViTAEv2中没有绝对位置编码,这段加载权重的代码可能是从什么地方直接复制过来的,当时没考虑不加载权重的情况,所以pretrained=None的时候,你把它注释掉

# if self.use_abs_pos_embed:
#    trunc_normal_(self.absolute_pos_embed, std=0.02)

好的,谢谢。

from rsp.

Related Issues (18)

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.