GithubHelp home page GithubHelp logo

Comments (7)

fyviezhao avatar fyviezhao commented on June 14, 2024 1

These are the variables that caused the second error:

gimg: tensor([[[0.7569, 0.7569, 0.7569, ..., 0.6706, 0.6706, 0.6706], [0.7569, 0.7569, 0.7569, ..., 0.6706, 0.6706, 0.6706], [0.7569, 0.7569, 0.7569, ..., 0.6706, 0.6706, 0.6706], ..., [0.7961, 0.7961, 0.7961, ..., 0.7490, 0.7412, 0.7490], [0.7961, 0.7961, 0.7961, ..., 0.7490, 0.7412, 0.7490], [0.7961, 0.7961, 0.7961, ..., 0.7490, 0.7490, 0.7490]],

    [[0.7569, 0.7569, 0.7569,  ..., 0.6863, 0.6863, 0.6863],
     [0.7569, 0.7569, 0.7569,  ..., 0.6863, 0.6863, 0.6863],
     [0.7569, 0.7569, 0.7569,  ..., 0.6863, 0.6863, 0.6863],
     ...,
     [0.7961, 0.7961, 0.7961,  ..., 0.7647, 0.7569, 0.7647],
     [0.7961, 0.7961, 0.7961,  ..., 0.7647, 0.7569, 0.7647],
     [0.7961, 0.7961, 0.7961,  ..., 0.7647, 0.7647, 0.7647]],

    [[0.7569, 0.7569, 0.7412,  ..., 0.6784, 0.6784, 0.6784],
     [0.7569, 0.7569, 0.7412,  ..., 0.6784, 0.6784, 0.6784],
     [0.7569, 0.7569, 0.7412,  ..., 0.6784, 0.6784, 0.6784],
     ...,
     [0.7961, 0.7961, 0.7961,  ..., 0.7569, 0.7490, 0.7569],
     [0.7961, 0.7961, 0.7961,  ..., 0.7569, 0.7490, 0.7569],
     [0.7961, 0.7961, 0.7961,  ..., 0.7569, 0.7569, 0.7569]]],
   device='cuda:0')

gimg type: <class 'torch.Tensor'> gparse: tensor([[0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], ..., [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0]], device='cuda:0', dtype=torch.uint8) gparse type: <class 'torch.Tensor'> gid[2]: 5 gid[2] type: <class 'int'>

The error is in this line: { gimgs += [gimg * (gparse == gid[2])] }

RuntimeError: expected type torch.cuda.FloatTensor but got torch.cuda.ByteTensor

Modifying gimgs += [gimg * (gparse == gid[2])] to gimgs += [gimg * (gparse == gid[2]).to(torch.float32)] can fix this error.

from dressing-in-order.

cuiaiyu avatar cuiaiyu commented on June 14, 2024

Maybe you can run pimg, parse, from_pose = load_img(pid, ds) and print the size and type for pimg, parse, from_pose to first check whether all the data are loaded properly?

from dressing-in-order.

AhmedHashish123 avatar AhmedHashish123 commented on June 14, 2024

pimg size: torch.Size([3, 256, 176])
pimg type<class 'torch.Tensor'>
parse size: torch.Size([256, 176])
parse type: <class 'torch.Tensor'>
from_pose size: torch.Size([18, 256, 176])
from_pose type: <class 'torch.Tensor'>

I believe the problem with the first error
{
TypeError: ne() received an invalid combination of arguments - got (NoneType), but expected one of:

(Tensor other)
didn't match because some of the arguments have invalid types: (!NoneType!)
(Number other)
didn't match because some of the arguments have invalid types: (!NoneType!)
}
is that a tensor is being compared to a None type
{
if pose != None:
}

from dressing-in-order.

AhmedHashish123 avatar AhmedHashish123 commented on June 14, 2024

These are the variables that caused the second error:

gimg: tensor([[[0.7569, 0.7569, 0.7569, ..., 0.6706, 0.6706, 0.6706],
[0.7569, 0.7569, 0.7569, ..., 0.6706, 0.6706, 0.6706],
[0.7569, 0.7569, 0.7569, ..., 0.6706, 0.6706, 0.6706],
...,
[0.7961, 0.7961, 0.7961, ..., 0.7490, 0.7412, 0.7490],
[0.7961, 0.7961, 0.7961, ..., 0.7490, 0.7412, 0.7490],
[0.7961, 0.7961, 0.7961, ..., 0.7490, 0.7490, 0.7490]],

    [[0.7569, 0.7569, 0.7569,  ..., 0.6863, 0.6863, 0.6863],
     [0.7569, 0.7569, 0.7569,  ..., 0.6863, 0.6863, 0.6863],
     [0.7569, 0.7569, 0.7569,  ..., 0.6863, 0.6863, 0.6863],
     ...,
     [0.7961, 0.7961, 0.7961,  ..., 0.7647, 0.7569, 0.7647],
     [0.7961, 0.7961, 0.7961,  ..., 0.7647, 0.7569, 0.7647],
     [0.7961, 0.7961, 0.7961,  ..., 0.7647, 0.7647, 0.7647]],

    [[0.7569, 0.7569, 0.7412,  ..., 0.6784, 0.6784, 0.6784],
     [0.7569, 0.7569, 0.7412,  ..., 0.6784, 0.6784, 0.6784],
     [0.7569, 0.7569, 0.7412,  ..., 0.6784, 0.6784, 0.6784],
     ...,
     [0.7961, 0.7961, 0.7961,  ..., 0.7569, 0.7490, 0.7569],
     [0.7961, 0.7961, 0.7961,  ..., 0.7569, 0.7490, 0.7569],
     [0.7961, 0.7961, 0.7961,  ..., 0.7569, 0.7569, 0.7569]]],
   device='cuda:0')

gimg type: <class 'torch.Tensor'>
gparse: tensor([[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
...,
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0]], device='cuda:0', dtype=torch.uint8)
gparse type: <class 'torch.Tensor'>
gid[2]: 5
gid[2] type: <class 'int'>

The error is in this line:
{
gimgs += [gimg * (gparse == gid[2])]
}

RuntimeError: expected type torch.cuda.FloatTensor but got torch.cuda.ByteTensor

from dressing-in-order.

fyviezhao avatar fyviezhao commented on June 14, 2024

pimg size: torch.Size([3, 256, 176]) pimg type<class 'torch.Tensor'> parse size: torch.Size([256, 176]) parse type: <class 'torch.Tensor'> from_pose size: torch.Size([18, 256, 176]) from_pose type: <class 'torch.Tensor'>

I believe the problem with the first error { TypeError: ne() received an invalid combination of arguments - got (NoneType), but expected one of:

(Tensor other) didn't match because some of the arguments have invalid types: (!NoneType!) (Number other) didn't match because some of the arguments have invalid types: (!NoneType!) } is that a tensor is being compared to a None type { if pose != None: }

This can be solved by changing if pose != None to if type(pose) != type(None) in the plot_image funciton in the demo.ipynb.

from dressing-in-order.

AhmedHashish123 avatar AhmedHashish123 commented on June 14, 2024

These are the variables that caused the second error:
gimg: tensor([[[0.7569, 0.7569, 0.7569, ..., 0.6706, 0.6706, 0.6706], [0.7569, 0.7569, 0.7569, ..., 0.6706, 0.6706, 0.6706], [0.7569, 0.7569, 0.7569, ..., 0.6706, 0.6706, 0.6706], ..., [0.7961, 0.7961, 0.7961, ..., 0.7490, 0.7412, 0.7490], [0.7961, 0.7961, 0.7961, ..., 0.7490, 0.7412, 0.7490], [0.7961, 0.7961, 0.7961, ..., 0.7490, 0.7490, 0.7490]],

    [[0.7569, 0.7569, 0.7569,  ..., 0.6863, 0.6863, 0.6863],
     [0.7569, 0.7569, 0.7569,  ..., 0.6863, 0.6863, 0.6863],
     [0.7569, 0.7569, 0.7569,  ..., 0.6863, 0.6863, 0.6863],
     ...,
     [0.7961, 0.7961, 0.7961,  ..., 0.7647, 0.7569, 0.7647],
     [0.7961, 0.7961, 0.7961,  ..., 0.7647, 0.7569, 0.7647],
     [0.7961, 0.7961, 0.7961,  ..., 0.7647, 0.7647, 0.7647]],

    [[0.7569, 0.7569, 0.7412,  ..., 0.6784, 0.6784, 0.6784],
     [0.7569, 0.7569, 0.7412,  ..., 0.6784, 0.6784, 0.6784],
     [0.7569, 0.7569, 0.7412,  ..., 0.6784, 0.6784, 0.6784],
     ...,
     [0.7961, 0.7961, 0.7961,  ..., 0.7569, 0.7490, 0.7569],
     [0.7961, 0.7961, 0.7961,  ..., 0.7569, 0.7490, 0.7569],
     [0.7961, 0.7961, 0.7961,  ..., 0.7569, 0.7569, 0.7569]]],
   device='cuda:0')

gimg type: <class 'torch.Tensor'> gparse: tensor([[0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], ..., [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0]], device='cuda:0', dtype=torch.uint8) gparse type: <class 'torch.Tensor'> gid[2]: 5 gid[2] type: <class 'int'>
The error is in this line: { gimgs += [gimg * (gparse == gid[2])] }
RuntimeError: expected type torch.cuda.FloatTensor but got torch.cuda.ByteTensor

Modifying gimgs += [gimg * (gparse == gid[2])] to gimgs += [gimg * (gparse == gid[2]).to(torch.float32)] can fix this error.

Thank you. I will try your solutions. I will close the issue in the mean time and reopen it if the solution doesn't work.

from dressing-in-order.

xuCW1 avatar xuCW1 commented on June 14, 2024

Hello,I had the same problem as you and tried the solutions above without success. Have you successfully solved it now?I really need your help, thank you!

from dressing-in-order.

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.