Code Monkey home page Code Monkey logo

mctrans's People

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  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  avatar  avatar

mctrans's Issues

使用其他数据集出现的问题 AttributeError: 'ConfigDict' object has no attribute 'log_level'等等

我是用自己的数据集,使用模型mctrans_vgg32_d5.py,
显示:Traceback (most recent call last):
File "G:/codelearn/papercode329/3MCTrans-master/tools/train.py", line 128, in
main()
File "G:/codelearn/papercode329/3MCTrans-master/tools/train.py", line 103, in main
print(cfg.log_level)
File "g:\pythonproject\swin-zhenghe\mmcv-1.3.1\mmcv\utils\config.py", line 425, in getattr
return getattr(self._cfg_dict, name)
File "g:\pythonproject\swin-zhenghe\mmcv-1.3.1\mmcv\utils\config.py", line 44, in getattr
raise ex
AttributeError: 'ConfigDict' object has no attribute 'log_level'
请问有人知道什么问题吗,感谢

手动将log level设置为0

出现错误:
AttributeError: 'ConfigDict' object has no attribute 'data'

我怀疑是配置文件没弄好,有大哥知道嘛

实验结果与论文不同

+---------------------------+--------+-------+-------+--------+-----------+--------+
| Class | Dice | Acc | IoU | Fscore | Precision | Recall |
+---------------------------+--------+-------+-------+--------+-----------+--------+
| Background | 142.16 | 600.0 | 245.8 | 142.16 | 80.63 | 600.0 |
| Neoplastic | 0.0 | 0.0 | 0.0 | nan | nan | 0.0 |
| Inflammatory | 0.0 | 0.0 | 0.0 | nan | nan | 0.0 |
| Connective | 0.0 | 0.0 | 0.0 | nan | nan | 0.0 |
| Dead | 0.0 | 0.0 | 0.0 | nan | nan | 0.0 |
| Non-Neoplastic Epithelial | 0.0 | 0.0 | 0.0 | nan | nan | 0.0 |
+---------------------------+--------+-------+-------+--------+-----------+--------+
这是我跑完模型它在log中统计的结果,为什么所有结果都是0?
而且我没有发现生成的预测图。

Test pipeline

Is there a simple test pipeline to visualize the prediction, or i just need to follow the guidance in mmseg?
But it seems, with a custom model is cant be tested as in guidance.
for example as i rewrite the /envs/mctrans/lib/python3.7/site-packages/mmseg/models/builder.py, in your builder there is no build_segmentor method
Traceback (most recent call last):
File "/home/MCTrans/test/result_visualize_single.py", line 6, in
from mmseg.apis import init_segmentor, show_result_pyplot, inference_segmentor
File "/home/miniconda3/envs/mctrans/lib/python3.7/site-packages/mmseg/apis/init.py", line 2, in
from .inference import inference_segmentor, init_segmentor, show_result_pyplot
File "/home/miniconda3/envs/mctrans/lib/python3.7/site-packages/mmseg/apis/inference.py", line 9, in
from mmseg.models import build_segmentor
ImportError: cannot import name 'build_segmentor' from 'mmseg.models'

Is there a simple test pipeline?

Some questions about your code

Hi, thank you for your work. But I've noticed some inconsistencies with your paper:

  1. It seems like the features extracted by the self-attention module are fed into the UNet decoder directly instead of the cross-attention module.
  2. Proxy embedding is added to each input of the cross-attention layer, which seems not mentioned in the paper.

But maybe I misunderstood something? Look forward to your reply.

About the Auxillary Loss

Hi!
Thanks for your code. I have a question about the Auxillary Loss. What's the gt for Auxillary Loss? Thank you very much!

请问使用.npy格式的数据和使用.png格式的数据有区别吗

首先感谢作者的工作!您提供的PanNuke数据集里面有split-images(masks)-npy和split-images(masks),前者是.npy格式,后者是.png格式,请问使用这两种不同格式的数据集进行训练和测试是等价的吗?因为我load了npy格式的,发现其中的数据也是0~255的,和png格式的数据是一样的,是不是代表着使用.png格式的数据可以获得和.npy格式数据的同样效果?感谢!

Multi GPU Training

Dear author:
什么时候公开多GPU训练的代码呢,想学习一下

DLL load failed

How can I solve this problems? Thanks you very much!!!

Traceback (most recent call last): File "Z:\py_item\7_MCTrans-master\MCTrans-master\tools\train.py", line 14, in <module> from mctrans.pipline import SegPipline File "Z:\py_item\7_MCTrans-master\MCTrans-master\mctrans\pipline\__init__.py", line 1, in <module> from .segpipline import SegPipline File "Z:\py_item\7_MCTrans-master\MCTrans-master\mctrans\pipline\segpipline.py", line 7, in <module> from mctrans.models import build_model File "Z:\py_item\7_MCTrans-master\MCTrans-master\mctrans\models\__init__.py", line 1, in <module> from .centers import * File "Z:\py_item\7_MCTrans-master\MCTrans-master\mctrans\models\centers\__init__.py", line 1, in <module> from .mctrans import MCTrans File "Z:\py_item\7_MCTrans-master\MCTrans-master\mctrans\models\centers\mctrans.py", line 8, in <module> from ..ops.modules import MSDeformAttn File "Z:\py_item\7_MCTrans-master\MCTrans-master\mctrans\models\ops\modules\__init__.py", line 9, in <module> from .ms_deform_attn import MSDeformAttn File "Z:\py_item\7_MCTrans-master\MCTrans-master\mctrans\models\ops\modules\ms_deform_attn.py", line 21, in <module> from ..functions import MSDeformAttnFunction File "Z:\py_item\7_MCTrans-master\MCTrans-master\mctrans\models\ops\functions\__init__.py", line 9, in <module> from .ms_deform_attn_func import MSDeformAttnFunction File "Z:\py_item\7_MCTrans-master\MCTrans-master\mctrans\models\ops\functions\ms_deform_attn_func.py", line 18, in <module> import MultiScaleDeformableAttention as MSDA ImportError: DLL load failed: 找不到指定的模块。

unet_vgg32_d5_256x256_400ep_pannuke.py

你好,我在运行程序时,出现了如下错误:
FileNotFoundError: file "/home/yyang17/projects/MCTrans/configs/debug/unet_vgg32_d5_256x256_400ep_pannuke.py" does not exist
在项目里面搜索 unet_vgg32_d5_256x256_400ep_pannuke.py 也没有发现,请问是否有部分模型文件没有上传呢?

No normal access

The MCTrans link given in the readme section is not accessible

训练这个模型在其他数据集

你好,我将这个模型用于别的数据集(19类),并更改了配置文件里的类别个数,但似乎并不能直接运行起来,出现了下面的错误:

Traceback (most recent call last):
  File "/mnt/csip-102/CaiJiaXin/MCTrans-master/train.py", line 131, in <module>
    main()
  File "/mnt/csip-102/CaiJiaXin/MCTrans-master/train.py", line 127, in main
    SegPipline(cfg, distributed, not args.no_validate).run()
  File "/mnt/csip-102/CaiJiaXin/MCTrans-master/mctrans/pipline/segpipline.py", line 99, in run
    self.runner.run(self.data_loaders, self.cfg.workflow, self.cfg.max_epochs)
  File "/opt/conda/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run
    epoch_runner(data_loaders[i], **kwargs)
  File "/opt/conda/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 50, in train
    self.run_iter(data_batch, train_mode=True, **kwargs)
  File "/opt/conda/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 30, in run_iter
    **kwargs)
  File "/opt/conda/lib/python3.7/site-packages/mmcv/parallel/data_parallel.py", line 75, in train_step
    return self.module.train_step(*inputs[0], **kwargs[0])
  File "/mnt/csip-102/CaiJiaXin/MCTrans-master/mctrans/models/segmentors/base.py", line 152, in train_step
    losses = self(**data_batch)
  File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/opt/conda/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 109, in new_func
    return old_func(*args, **kwargs)
  File "/mnt/csip-102/CaiJiaXin/MCTrans-master/mctrans/models/segmentors/base.py", line 122, in forward
    return self.forward_train(img, img_metas, **kwargs)
  File "/mnt/csip-102/CaiJiaXin/MCTrans-master/mctrans/models/segmentors/encoder_decoder.py", line 92, in forward_train
    loss_aux = self._auxiliary_head_forward(x, seg_label, return_loss=True)
  File "/mnt/csip-102/CaiJiaXin/MCTrans-master/mctrans/models/segmentors/encoder_decoder.py", line 81, in _auxiliary_head_forward
    return self.aux_head.forward_train(x, seg_label)
  File "/mnt/csip-102/CaiJiaXin/MCTrans-master/mctrans/models/heads/mctrans_aux_head.py", line 49, in forward_train
    outputs = self.ca(inputs_flatten)
  File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/mnt/csip-102/CaiJiaXin/MCTrans-master/mctrans/models/trans/transformer.py", line 145, in forward
    query = layer(query, src)
  File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/mnt/csip-102/CaiJiaXin/MCTrans-master/mctrans/models/trans/transformer.py", line 122, in forward
    tgt2 = self.cross_attn(tgt, src, src)[0]
  File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
    return forward_call(*input, **kwargs)
  File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/activation.py", line 1038, in forward
    attn_mask=attn_mask)
  File "/opt/conda/lib/python3.7/site-packages/torch/nn/functional.py", line 5025, in multi_head_attention_forward
    k = k.contiguous().view(-1, bsz * num_heads, head_dim).transpose(0, 1)
RuntimeError: shape '[-1, 152, 16]' is invalid for input of size 2752512 

我看到关闭的问题中也有类似问题,但我按照他的修改方式也并不能成功,期待你的解答

code

When can the code be made public?

gpu memory

Hi,
Thanks for your great job, i like your algorithm very much.
i have been trying to reproduce your result, may i ask how big is your gpu memory, i have 16GB, but always "CUDA out of memory."

proxy embedding

Hello, I would like to know the meaning of the specific proxy embedding.

i had run this project and found an RuntimeError: shape '[32, 48, 16]' is invalid for input of size 22020096.

I use the pannuke dataset. But I found an error.
Traceback (most recent call last): File "tools/train.py", line 138, in <module> main() File "tools/train.py", line 135, in main SegPipline(cfg, distributed, not args.no_validate).run() File "/home/aMI_projects/MCTrans-master/mctrans/pipline/segpipline.py", line 99, in run self.runner.run(self.data_loaders, self.cfg.workflow, self.cfg.max_epochs) File "/home/anaconda3/envs/mctrans/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run epoch_runner(data_loaders[i], **kwargs) File "/home/anaconda3/envs/mctrans/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 50, in train self.run_iter(data_batch, train_mode=True, **kwargs) File "/home/anaconda3/envs/mctrans/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 30, in run_iter **kwargs) File "/home/anaconda3/envs/mctrans/lib/python3.7/site-packages/mmcv/parallel/data_parallel.py", line 75, in train_step return self.module.train_step(*inputs[0], **kwargs[0]) File "/home/aMI_projects/MCTrans-master/mctrans/models/segmentors/base.py", line 152, in train_step losses = self(**data_batch) File "/home/anaconda3/envs/mctrans/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/home/anaconda3/envs/mctrans/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 109, in new_func return old_func(*args, **kwargs) File "/home/aMI_projects/MCTrans-master/mctrans/models/segmentors/base.py", line 122, in forward return self.forward_train(img, img_metas, **kwargs) File "/home/aMI_projects/MCTrans-master/mctrans/models/segmentors/encoder_decoder.py", line 92, in forward_train loss_aux = self._auxiliary_head_forward(x, seg_label, return_loss=True) File "/home/aMI_projects/MCTrans-master/mctrans/models/segmentors/encoder_decoder.py", line 81, in _auxili ary_head_forward return self.aux_head.forward_train(x, seg_label) File "/home/aMI_projects/MCTrans-master/mctrans/models/heads/mctrans_aux_head.py", line 51, in forward_train outputs = self.ca(inputs_flatten) File "/home/anaconda3/envs/mctrans/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/home/aMI_projects/MCTrans-master/mctrans/models/trans/transformer.py", line 149, in forward query = layer(query, src) File "/home/anaconda3/envs/mctrans/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/home/aMI_projects/MCTrans-master/mctrans/models/trans/transformer.py", line 124, in forward tgt2 = self.cross_attn(tgt, src, src)[0] File "/home/anaconda3/envs/mctrans/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/home/anaconda3/envs/mctrans/lib/python3.7/site-packages/torch/nn/modules/activation.py", line 1045, in forward attn_mask=attn_mask, average_attn_weights=average_attn_weights) File "/home/anaconda3/envs/mctrans/lib/python3.7/site-packages/torch/nn/functional.py", line 5301, in multi_head_attention_forward k = k.contiguous().view(k.shape[0], bsz * num_heads, head_dim).transpose(0, 1) RuntimeError: shape '[32, 48, 16]' is invalid for input of size 22020096

CA module

Dear Author
I don't see the use of CA module in mctrans.py. Is the CA module useless?

question

Scource code cannot be aquired.

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.