Git Product home page Git Product logo

Comments (3)

bhusalsantosh avatar bhusalsantosh commented on July 3, 2024 3

The issue was due to the float value returned from line 50 in torchvision/models/segmentation/segmentation.py. I converted it into integer and reinstalled the torchvision 0.3.0 library and everything worked well until testing.

from pytorch-segmentation.

dusty-nv avatar dusty-nv commented on July 3, 2024

Hi @bhusalsantosh , try using the v0.3.0 branch of my torchvision fork here: https://github.com/dusty-nv/vision/commits/v0.3.0

It contains some patches that make the FCN_ResNet ONNX models able to be exported to TensorRT.

from pytorch-segmentation.

bhusalsantosh avatar bhusalsantosh commented on July 3, 2024

@dusty-nv . Thanks for getting back to me. I did the following steps with Torch 1.1.0 and Python3.6
$ sudo pip3 uninstall torchvision
$ python3 -c "import torchvision" # should make error if succesfully uninstalled
$ git clone -bv0.3.0 https://github.com/dusty-nv/vision
$ cd vision
$ sudo python3 setup.py install
as mentioned in (dusty-nv/jetson-inference#370 (comment))
I am getting the following error whenever calling any resnet segmentation model.
`$torchvision.models.segmentation.fcn_resnet18(num_classes=21, pretrained=False, export_onnx=True)
torchvision.models.segmentation.fcn_resnet18()
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/dist-packages/torchvision-0.3.0-py3.6-linux-aarch64.egg/torchvision/models/segmentation/segmentation.py", line 70, in fcn_resnet18
File "/usr/local/lib/python3.6/dist-packages/torchvision-0.3.0-py3.6-linux-aarch64.egg/torchvision/models/segmentation/segmentation.py", line 50, in _segm_resnet
File "/usr/local/lib/python3.6/dist-packages/torchvision-0.3.0-py3.6-linux-aarch64.egg/torchvision/models/segmentation/fcn.py", line 29, in init
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py", line 327, in init
False, _pair(0), groups, bias, padding_mode)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py", line 40, in init
out_channels, in_channels // groups, *kernel_size))
TypeError: new() received an invalid combination of arguments - got (float, float, int, int), but expected one of:

  • (torch.device device)
  • (torch.Storage storage)
  • (Tensor other)
  • (tuple of ints size, torch.device device)
  • (object data, torch.device device)`

How do I get over this issue?

from pytorch-segmentation.

Related Issues (8)

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.