GithubHelp home page GithubHelp logo

sun-1024 / da-transunet Goto Github PK

View Code? Open in Web Editor NEW
105.0 105.0 8.0 76 KB

DA-TransUNet: Combining Dual Attention of Position and Channel with Transformer U-net for Medical Image Segmentation

License: GNU General Public License v3.0

Python 100.00%

da-transunet's People

Contributors

learning1314never avatar sun-1024 avatar yizhipan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

da-transunet's Issues

where is Transformer/encoderblock

I am currently encountering an issue in my code and am seeking your expertise for guidance.

Error Message:

Traceback (most recent call last):
File "train.py", line 184, in
net.load_from(weights=np.load(config_vit.pretrained_path))
File "A:\DP_learn\DA-TransUnet-main\DA-TransUNet\DA-TransUNet\Architecture\DATransUNet.py", line 459, in load_from
unit.load_from(weights, n_block=uname)
File "A:\DP_learn\DA-TransUnet-main\DA-TransUNet\DA-TransUNet\Architecture\DATransUNet.py", line 209, in load_from
query_weight = np2th(weights[pjoin(ROOT, ATTENTION_Q, "kernel")]).view(self.hidden_size, self.hidden_size).t()
File "C:\Users\Wayne.conda\envs\DA\lib\site-packages\numpy\lib\npyio.py", line 260, in getitem
raise KeyError("%s is not a file in the archive" % key)
KeyError: 'Transformer/encoderblock_0\MultiHeadDotProductAttention_1/query\kernel is not a file in the archive'

I have checked the paths and files, but I am still unable to resolve the issue. I am uncertain whether the 'Transformer/encoderblock_0\MultiHeadDotProductAttention_1/query\kernel' path is correct or if there is a missing file.

代码运行报错

感谢您论文做出的工作,运行train文件会报错
File "/root/data1/DA-TransUNet/datasets/dataset_synapse.py", line 39, in call
x,y= image.shape
ValueError: too many values to unpack (expected 2)
请问该如何修改呢

索引溢出

请问,配置好环境后遇到的第一个错误是:receptive_field_size = tensor[0][0].numel()
IndexError: index 0 is out of bounds for dimension 0 with size 0。大家都是怎么解决的呀?

运行报错

菜鸟一枚,
KeyError: 'Transformer/encoderblock_0\MultiHeadDotProductAttention_1/query\kernel is not a file in the archive'

在运行test.py 时,snapshot 取值epoch_149.pth,但是epoch_149.pth的key出现错误,这种情况如何解决,或者需要跑完train.py得到模型参数吗?

代码 snapshot = os.path.join(snapshot_path, 'best_model.pth')
if not os.path.exists(snapshot): snapshot = snapshot.replace('best_model', 'epoch_'+str(args.max_epochs-1))
报错:C:\ProgramData\anaconda3\python.exe C:\Users\86133\Desktop\project_TransUNet\TransUNet\test.py
../model/TU_Synapse224/TU_pretrain_R50-ViT-B_16_skip3_epo150_bs24_224\epoch_149.pth
Traceback (most recent call last):
File "C:\Users\86133\Desktop\project_TransUNet\TransUNet\test.py", line 139, in
net.load_state_dict(torch.load(snapshot))
File "C:\Users\86133\AppData\Roaming\Python\Python311\site-packages\torch\nn\modules\module.py", line 2041, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for VisionTransformer:
Missing key(s) in state_dict: "transformer.embeddings.hybrid_model.body.block1/.unit1/.gn1.weight", "
Unexpected key(s) in state_dict: "transformer.embeddings.DAblock1.conv5a.0.weight",

进程已结束,退出代码为 1
epoch149

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.