GithubHelp home page GithubHelp logo

Comments (12)

rajdeinno avatar rajdeinno commented on August 28, 2024 3

from chexnet-with-localization.

rajdeinno avatar rajdeinno commented on August 28, 2024 2

It worked for me after I changed the name in denseNet_localization.py module.densenet121.features.denseblock4.denselayer16.conv.2 to module.densenet121.features.denseblock4.denselayer16.conv2

And I had some package version issues as well.

from chexnet-with-localization.

thtang avatar thtang commented on August 28, 2024

Do you use Pytorch==0.2.0 and torchvision==0.2.0 ?

from chexnet-with-localization.

rajdeinno avatar rajdeinno commented on August 28, 2024

I am using the below version since I had some problem with torchvision 0.2.0.

torch==1.1.0
torchvision==0.2.2

Additional info:
I ran my training by using the below requirements in Ubuntu 16.04.

python== 3.5.6
pip 19.1.1
pkg-resources 0.0.0
setuptools 41.0.1
wheel 0.33.4

cycler==0.10.0
decorator==4.4.0
imageio==2.5.0
joblib==0.13.2
matplotlib==2.1.1
networkx==2.3
numpy==1.13.3
opencv-python==3.4.0.12
pandas==0.24.2
Pillow==6.0.0
pyparsing==2.4.0
python-dateutil==2.8.0
pytz==2019.1
PyWavelets==1.0.3
scikit-image==0.13.1
scikit-learn==0.21.1
scipy==1.0.0
six==1.12.0
torch==1.1.0
torchvision==0.2.2

from chexnet-with-localization.

rajdeinno avatar rajdeinno commented on August 28, 2024

If I use torchvision 0.2.0 and torch==1.0.1 I get the following error.

warn("The default mode, 'constant', will be changed to 'reflect' in "
0
Traceback (most recent call last):
  File "denseNet_localization.py", line 76, in <module>
    model = DenseNet121(8).cuda()
  File "denseNet_localization.py", line 65, in __init__
    self.densenet121 = torchvision.models.densenet121(pretrained=True)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 26, in densenet121
    **kwargs)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 142, in __init__
    bn_size=bn_size, growth_rate=growth_rate, drop_rate=drop_rate)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 98, in __init__
    layer = _DenseLayer(num_input_features + i * growth_rate, growth_rate, bn_size, drop_rate)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 77, in __init__
    self.add_module('norm.1', nn.BatchNorm2d(num_input_features)),
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 180, in add_module
    raise KeyError("module name can't contain \".\"")
KeyError: 'module name can\'t contain "."'

So I have upgraded torchvision to 0.2.2. and torch==1.1.0. and my train went successful. When I try to run denseNet_localization.py file then I got the above error.

from chexnet-with-localization.

thtang avatar thtang commented on August 28, 2024

Ok, so it seems that the errors are just caused by the different version of packages.

from chexnet-with-localization.

mochita314 avatar mochita314 commented on August 28, 2024

I changed
module.densenet121.features.denseblock4.denselayer16.conv.2 to module.densenet121.features.denseblock4.denselayer16.conv2
but still have same problem.
What should I do ... ??

I'm using
torch (1.0.1.post2)
torchvision (0.2.2.post3)

  File "denseNet_localization.py", line 247, in <module>
    output = gcam.generate(target_layer="module.densenet121.features.denseblock4.denselayer16.conv2")
  File "denseNet_localization.py", line 211, in generate
    fmaps = self._find(self.all_fmaps, target_layer)
  File "denseNet_localization.py", line 199, in _find
    raise ValueError('Invalid layer name: {}'.format(target_layer))
ValueError: Invalid layer name: module.densenet121.features.denseblock4.denselayer16.conv2```

from chexnet-with-localization.

sp7414 avatar sp7414 commented on August 28, 2024

I changed
module.densenet121.features.denseblock4.denselayer16.conv.2 to module.densenet121.features.denseblock4.denselayer16.conv2
but still have same problem.
What should I do ... ??

I'm using
torch (1.0.1.post2)
torchvision (0.2.2.post3)

  File "denseNet_localization.py", line 247, in <module>
    output = gcam.generate(target_layer="module.densenet121.features.denseblock4.denselayer16.conv2")
  File "denseNet_localization.py", line 211, in generate
    fmaps = self._find(self.all_fmaps, target_layer)
  File "denseNet_localization.py", line 199, in _find
    raise ValueError('Invalid layer name: {}'.format(target_layer))
ValueError: Invalid layer name: module.densenet121.features.denseblock4.denselayer16.conv2```

have you solved this problem? I'm facing the same issue.

from chexnet-with-localization.

ankitdata avatar ankitdata commented on August 28, 2024

I changed
module.densenet121.features.denseblock4.denselayer16.conv.2 to module.densenet121.features.denseblock4.denselayer16.conv2
but still have same problem.
What should I do ... ??
I'm using
torch (1.0.1.post2)
torchvision (0.2.2.post3)

  File "denseNet_localization.py", line 247, in <module>
    output = gcam.generate(target_layer="module.densenet121.features.denseblock4.denselayer16.conv2")
  File "denseNet_localization.py", line 211, in generate
    fmaps = self._find(self.all_fmaps, target_layer)
  File "denseNet_localization.py", line 199, in _find
    raise ValueError('Invalid layer name: {}'.format(target_layer))
ValueError: Invalid layer name: module.densenet121.features.denseblock4.denselayer16.conv2```

have you solved this problem? I'm facing the same issue.

see this issue might helpfull

from chexnet-with-localization.

Aliktk avatar Aliktk commented on August 28, 2024

If I use torchvision 0.2.0 and torch==1.0.1 I get the following error.

warn("The default mode, 'constant', will be changed to 'reflect' in "
0
Traceback (most recent call last):
  File "denseNet_localization.py", line 76, in <module>
    model = DenseNet121(8).cuda()
  File "denseNet_localization.py", line 65, in __init__
    self.densenet121 = torchvision.models.densenet121(pretrained=True)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 26, in densenet121
    **kwargs)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 142, in __init__
    bn_size=bn_size, growth_rate=growth_rate, drop_rate=drop_rate)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 98, in __init__
    layer = _DenseLayer(num_input_features + i * growth_rate, growth_rate, bn_size, drop_rate)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 77, in __init__
    self.add_module('norm.1', nn.BatchNorm2d(num_input_features)),
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 180, in add_module
    raise KeyError("module name can't contain \".\"")
KeyError: 'module name can\'t contain "."'

So I have upgraded torchvision to 0.2.2. and torch==1.1.0. and my train went successful. When I try to run denseNet_localization.py file then I got the above error.

Hello @rajdeinno how did u solve this error please healp me in this regard.
Thanks @rajdeinno

from chexnet-with-localization.

ankitdata avatar ankitdata commented on August 28, 2024

If I use torchvision 0.2.0 and torch==1.0.1 I get the following error.

warn("The default mode, 'constant', will be changed to 'reflect' in "
0
Traceback (most recent call last):
  File "denseNet_localization.py", line 76, in <module>
    model = DenseNet121(8).cuda()
  File "denseNet_localization.py", line 65, in __init__
    self.densenet121 = torchvision.models.densenet121(pretrained=True)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 26, in densenet121
    **kwargs)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 142, in __init__
    bn_size=bn_size, growth_rate=growth_rate, drop_rate=drop_rate)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 98, in __init__
    layer = _DenseLayer(num_input_features + i * growth_rate, growth_rate, bn_size, drop_rate)
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torchvision/models/densenet.py", line 77, in __init__
    self.add_module('norm.1', nn.BatchNorm2d(num_input_features)),
  File "/home/administrator/Desktop/Projects/xray/chexnet/setup3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 180, in add_module
    raise KeyError("module name can't contain \".\"")
KeyError: 'module name can\'t contain "."'

So I have upgraded torchvision to 0.2.2. and torch==1.1.0. and my train went successful. When I try to run denseNet_localization.py file then I got the above error.

Hello @rajdeinno how did u solve this error please healp me in this regard.
Thanks @rajdeinno

check this.
#7 (comment)

from chexnet-with-localization.

Aliktk avatar Aliktk commented on August 28, 2024

Hi Tang, I am able to generate the bound_box.txt file after I execute the denseNet_localization.pyfile. how to visualize the bound box text file into the input image? as you mentioned in ground-truth label (red) and its prediction (blue). Thanks in advance.. Please assist me on this..

Sent from my iPhone
On 28-May-2019, at 17:57, T.H. Tang @.***> wrote: It seem that the errors are just caused by the different version of packages. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

@rajdeinno hello sir after generating BB file how you print BB on that image with heatmap of that image?
Pleae help

from chexnet-with-localization.

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.