Code Monkey home page Code Monkey logo

Comments (4)

giddyyupp avatar giddyyupp commented on June 20, 2024

Hello,
looks like the problem is with the image width, not the channel. are you using the resize operations, specifically "--resize_or_crop" flag with any other option than "None". Else you need to resize your images to 256x256. If you are doing so and still there is a problem, could you share me a sample failing image file so I can debug and try to figure out the problem.

Best

from ganilla.

hdnh2006 avatar hdnh2006 commented on June 20, 2024

Hi @giddyyupp ,

I am getting the same error. These are the parameters I am using:
python test.py --dataroot ../my_own_data --name PP --model test --gpu_ids 0 --loadSize 512 --fineSize 512 --resize_or_crop 'scale_width' --verbose

It happens just when I put the flag --resize_or_crop 'scale_width'.

And this is the error I get:
RuntimeError: The size of tensor a (44) must match the size of tensor b (43) at non-singleton dimension 2

Thanks

from ganilla.

hdnh2006 avatar hdnh2006 commented on June 20, 2024

Hello @giddyyupp,

I have a quick question regarding the input image size requirement. Could you kindly provide some information about the preferred dimensions or aspect ratio that the images should have?

I have tried using an image with dimensions of 4000x2250, which was accepted without any issues. However, I encountered difficulties when using images with dimensions such as 4496x2776. It would be helpful to know the specific aspect ratio or guidelines for the image dimensions.

Thank you in advance for your assistance.

from ganilla.

giddyyupp avatar giddyyupp commented on June 20, 2024

Hello,
Yes the problem is with the dimensions of the image indeed, since i faced the same problem. In the original CyleGan repo, they updated the implementation of 'scale_width' transform which makes sure that the height of the image becomes at least the crop size:
https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/9f8f61e5a375c2e01c5187d093ce9c2409f409b0/data/base_dataset.py#L135

I guess I need to update the transform part or the whole base_dataset.py :(

from ganilla.

Related Issues (17)

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.