Coder Social home page Coder Social logo

Comments (7)

lisherlock avatar lisherlock commented on August 24, 2024

And the tensor size of image_batch is [bs, 1, 224, 224]. But i don't know why the channel is 1.

from transunet.

Beckschen avatar Beckschen commented on August 24, 2024

Hello, thanks for your comments!

(1) The default channel in Synapse dataset is 1. But line 386-397 in vit_seg_modeling.py suggests:

if x.size()[1] == 1:
x = x.repeat(1,3,1,1)

So the code will automatically handle it.

(2) Line 74 you mentioned in trainer_synapse is used for visualization in tensorboard. Please remove it if you don't need it.

IndexError: index 1 is out of bounds for dimension 0 with size 1.

It suggests that the batch_size is 1 instead of >1. Please just simply print(len(image)) to see how many the batch_size is used during training.

Let me know if you have further questions. Thanks!

from transunet.

linyingyingkarina avatar linyingyingkarina commented on August 24, 2024

print(len(image))

hi, I have the same error during my training, my batch_size was set 16. when I print(len(image)), it was 1. how can I fix?? thanks

from transunet.

linyingyingkarina avatar linyingyingkarina commented on August 24, 2024

print(len(image))

hi, I have the same error during my training, my batch_size was set 16. when I print(len(image)), it was 1. how can I fix?? thanks

fixed by reducing some data, also adding more data can work.

from transunet.

LeelaWo avatar LeelaWo commented on August 24, 2024

print(len(image))

hi, I have the same error during my training, my batch_size was set 16. when I print(len(image)), it was 1. how can I fix?? thanks

fixed by reducing some data, also adding more data can work.

hello, I have the same question during my training. But I can't understand exactly what you mean "by reducing some data, also adding more data". Can you explain more details please ? thanks

from transunet.

LeelaWo avatar LeelaWo commented on August 24, 2024

print("{} {}".format(image_batch.type(), image_batch.size()))
image = image_batch[1, 0:1, :, :]
print(len(image))

The image_batch print torch.Size([6, 1, 224, 224]), and len(image) print 1 as @linyingyingkarina.
my settings of training: batch:6, image size: 224.

from transunet.

sym330 avatar sym330 commented on August 24, 2024

print(len(image))

hi, I have the same error during my training, my batch_size was set 16. when I print(len(image)), it was 1. how can I fix?? thanks

fixed by reducing some data, also adding more data can work.

Sorry, I didn't understand. Can you be more specific?

from transunet.

Related Issues (20)

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.