Code Monkey home page Code Monkey logo

Comments (10)

tienipia avatar tienipia commented on June 9, 2024 23

Just remove broken codes.

basenet/vgg16_bn.py

from torchvision import models
[-] from torchvision.models.vgg import model_urls < Remove Ln. 7

...

class vgg16_bn(torch.nn.Module):
    def __init__(self, pretrained=True, freeze=True):
        super(vgg16_bn, self).__init__()
[-]        model_urls['vgg16_bn'] = model_urls['vgg16_bn'].replace('https://', 'http://') < Remove Ln. 25

from craft-pytorch.

rlrocha90 avatar rlrocha90 commented on June 9, 2024 12

comment the "from torchvision.models.vgg import model_urls"
It worked here!

Insert all this:

all = [
'VGG', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn',
'vgg19_bn', 'vgg19',
]

model_urls = {
'vgg11': 'https://download.pytorch.org/models/vgg11-bbd30ac9.pth',
'vgg13': 'https://download.pytorch.org/models/vgg13-c768596a.pth',
'vgg16': 'https://download.pytorch.org/models/vgg16-397923af.pth',
'vgg19': 'https://download.pytorch.org/models/vgg19-dcbb9e9d.pth',
'vgg11_bn': 'https://download.pytorch.org/models/vgg11_bn-6002323d.pth',
'vgg13_bn': 'https://download.pytorch.org/models/vgg13_bn-abd245e5.pth',
'vgg16_bn': 'https://download.pytorch.org/models/vgg16_bn-6c64b313.pth',
'vgg19_bn': 'https://download.pytorch.org/models/vgg19_bn-c79401a0.pth',
}

Or insert this for Resnet:

all = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']

model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth',
'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth',
'resnet101': 'https://download.pytorch.org/models/resnet101-5d3b4d8f.pth',
'resnet152': 'https://download.pytorch.org/models/resnet152-b121ed2d.pth',
}

from craft-pytorch.

adamdoescode avatar adamdoescode commented on June 9, 2024 4

Downgrading to torchvision==0.13 worked for me

from craft-pytorch.

PooyanRezaeipour avatar PooyanRezaeipour commented on June 9, 2024

Downgrading to torchvision==0.13 worked for me

does not work bro

from craft-pytorch.

ami-navon avatar ami-navon commented on June 9, 2024

+1

from craft-pytorch.

Devang-C avatar Devang-C commented on June 9, 2024

comment the "from torchvision.models.vgg import model_urls" It worked here!

Insert all this:

all = [ 'VGG', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn', 'vgg19_bn', 'vgg19', ]

model_urls = { 'vgg11': 'https://download.pytorch.org/models/vgg11-bbd30ac9.pth', 'vgg13': 'https://download.pytorch.org/models/vgg13-c768596a.pth', 'vgg16': 'https://download.pytorch.org/models/vgg16-397923af.pth', 'vgg19': 'https://download.pytorch.org/models/vgg19-dcbb9e9d.pth', 'vgg11_bn': 'https://download.pytorch.org/models/vgg11_bn-6002323d.pth', 'vgg13_bn': 'https://download.pytorch.org/models/vgg13_bn-abd245e5.pth', 'vgg16_bn': 'https://download.pytorch.org/models/vgg16_bn-6c64b313.pth', 'vgg19_bn': 'https://download.pytorch.org/models/vgg19_bn-c79401a0.pth', }

Or insert this for Resnet:

all = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152']

model_urls = { 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth', 'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth', 'resnet101': 'https://download.pytorch.org/models/resnet101-5d3b4d8f.pth', 'resnet152': 'https://download.pytorch.org/models/resnet152-b121ed2d.pth', }

This worked for me. I had problem in the easyocr library that was using the vgg models. Made the changes that you mentioned in their modules.py and it worked. Thank you very much.

from craft-pytorch.

MKaczkow avatar MKaczkow commented on June 9, 2024

For current version of torchvision (0.16.2) the import should be:

from torchvision.models.vgg import VGG16_BN_Weights

but the code is not used anyway, so best to just remove it like mentioned:

Just remove broken codes.

basenet/vgg16_bn.py

from torchvision import models
[-] from torchvision.models.vgg import model_urls < Remove Ln. 7

...

class vgg16_bn(torch.nn.Module):
    def __init__(self, pretrained=True, freeze=True):
        super(vgg16_bn, self).__init__()
[-]        model_urls['vgg16_bn'] = model_urls['vgg16_bn'].replace('https://', 'http://') < Remove Ln. 25

Also, check this SO post.

from craft-pytorch.

vikasr111 avatar vikasr111 commented on June 9, 2024

I am facing the same issue. Is there a chance we can commit the fix in this repo?
It'd make the life easier.

from craft-pytorch.

MKaczkow avatar MKaczkow commented on June 9, 2024

I think there is a PR currently open:
#202
But tbh, I don't understand why bbox.py is also modified

from craft-pytorch.

CrasCris avatar CrasCris commented on June 9, 2024

rlrocha90

If you have proxy config didn't work :c

from craft-pytorch.

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.