Code Monkey home page Code Monkey logo

Comments (4)

isaaccorley avatar isaaccorley commented on July 17, 2024 1

Yeah it should actually be x = x.permute(1, 2, 0). I think the valid inputs of transpose may have changed over time. I'll make a fix for this and for checking that your input dims are correct as well.

from pytorch-enhance.

isaaccorley avatar isaaccorley commented on July 17, 2024 1

Fixed in #7 and #8. Removed the permute/transpose op since this breaks for batch of images. I was mostly using this to just quickly upres a single image and format it to be easily plotted but I think this is a better compromise.

from pytorch-enhance.

isaaccorley avatar isaaccorley commented on July 17, 2024

@robmarkcole What is the shape of test_images[0]? PyTorch models require a batch dimension so I would think that's the issue. Try doing sr_img = model.enhance(test_images[0].unsqueeze(0)).

from pytorch-enhance.

robmarkcole avatar robmarkcole commented on July 17, 2024
test_images[0].shape

torch.Size([1, 200, 200])

What is required is torch.Size([1, 1, 200, 200] so I try:

sr_img = model.enhance(torch.unsqueeze(test_images[0], 0))

getting

---> 80         x = x.transpose((1, 2, 0))
     81         return x

TypeError: transpose() received an invalid combination of arguments - got (tuple), but expected one of:
 * (name dim0, name dim1)
 * (int dim0, int dim1)
 * 

Might be a bug here? Pretty sure the transpose is not required

In this example they are using input = img_to_tensor(y).view(1, -1, y.size[1], y.size[0]) which achieves the same result..?

from pytorch-enhance.

Related Issues (11)

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.