Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the pytorch version for your pre-trained model? #2

Open
GuanqiHe opened this issue Aug 27, 2021 · 2 comments
Open

What's the pytorch version for your pre-trained model? #2

GuanqiHe opened this issue Aug 27, 2021 · 2 comments

Comments

@GuanqiHe
Copy link

What's the pytorch version for your pre-trained model? My torch version is 1.7.1 but something abour pytorch goes wrong when I ran the script hand_detector_V2.py. Could you please add some information about your environment? Thanks!

@jesus-333
Copy link
Owner

I don't remember but when I created the project the PyTorch version was the last available in summer 2020. By the way what is your error?

@andyhsih8
Copy link

andyhsih8 commented Apr 15, 2022

Hi jesus,
I have the same problem with GuanqiHe.

I ran the script hand_detector_V2.py the error is below:

C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torchvision.models.detection.transform.GeneralizedRCNNTransform' has changed. Tried to save a patch, but couldn't create a writable file GeneralizedRCNNTransform.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torchvision.models.detection.backbone_utils.BackboneWithFPN' has changed. Tried to save a patch, but couldn't create a writable file BackboneWithFPN.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. Tried to save a patch, but couldn't create a writable file Conv2d.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torchvision.ops.misc.FrozenBatchNorm2d' has changed. Tried to save a patch, but couldn't create a writable file FrozenBatchNorm2d.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.activation.ReLU' has changed. Tried to save a patch, but couldn't create a writable file ReLU.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. Tried to save a patch, but couldn't create a writable file MaxPool2d.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. Tried to save a patch, but couldn't create a writable file Sequential.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torchvision.ops.feature_pyramid_network.FeaturePyramidNetwork' has changed. Tried to save a patch, but couldn't create a writable file FeaturePyramidNetwork.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.container.ModuleList' has changed. Tried to save a patch, but couldn't create a writable file ModuleList.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torchvision.ops.feature_pyramid_network.LastLevelMaxPool' has changed. Tried to save a patch, but couldn't create a writable file LastLevelMaxPool.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torchvision.models.detection.rpn.RegionProposalNetwork' has changed. Tried to save a patch, but couldn't create a writable file RegionProposalNetwork.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torchvision.models.detection.anchor_utils.AnchorGenerator' has changed. Tried to save a patch, but couldn't create a writable file AnchorGenerator.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torchvision.models.detection.rpn.RPNHead' has changed. Tried to save a patch, but couldn't create a writable file RPNHead.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torchvision.models.detection.roi_heads.RoIHeads' has changed. Tried to save a patch, but couldn't create a writable file RoIHeads.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torchvision.ops.poolers.MultiScaleRoIAlign' has changed. Tried to save a patch, but couldn't create a writable file MultiScaleRoIAlign.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. Tried to save a patch, but couldn't create a writable file Linear.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'hand_classification_net.CNNModel' has changed. Tried to save a patch, but couldn't create a writable file CNNModel.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. Tried to save a patch, but couldn't create a writable file Conv2d.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.activation.ReLU' has changed. Tried to save a patch, but couldn't create a writable file ReLU.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. Tried to save a patch, but couldn't create a writable file MaxPool2d.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. Tried to save a patch, but couldn't create a writable file Linear.patch. Make sure it doesn't exist and your working directory is writable.
warnings.warn(msg, SourceChangeWarning)
Traceback (most recent call last):
File "hand_detector_V2.py", line 86, in
boxes_predict = trackingHandWithRCNN(hand_tracker, frame, device)
File "E:\HandTracking_Test\Hand-Tracking-Pytorch\hand_detector_utils.py", line 94, in trackingHandWithRCNN
predictions = model([img])
File "C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "C:\Users\x\anaconda3\envs\test\lib\site-packages\torchvision\models\detection\generalized_rcnn.py", line 96, in forward
features = self.backbone(images.tensors)
File "C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "C:\Users\x\anaconda3\envs\test\lib\site-packages\torchvision\models\detection\backbone_utils.py", line 43, in forward
x = self.body(x)
File "C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "C:\Users\x\anaconda3\envs\test\lib\site-packages\torchvision\models_utils.py", line 63, in forward
x = module(x)
File "C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "C:\Users\x\anaconda3\envs\test\lib\site-packages\torchvision\ops\misc.py", line 94, in forward
scale = w * (rv + self.eps).rsqrt()
File "C:\Users\x\anaconda3\envs\test\lib\site-packages\torch\nn\modules\module.py", line 779, in getattr
type(self).name, name))

torch.nn.modules.module.ModuleAttributeError: 'FrozenBatchNorm2d' object has no attribute 'eps'
[ WARN:[email protected]] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (539) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback

My environment is python 3.7.10

pip list

Package Version


certifi 2021.10.8
cycler 0.11.0
dm-tree 0.1.6
fonttools 4.32.0
kiwisolver 1.4.2
matplotlib 3.5.1
mkl-fft 1.3.1
mkl-random 1.2.2
mkl-service 2.4.0
numpy 1.21.5
opencv-python 4.5.5.64
packaging 21.3
pandas 1.3.5
Pillow 9.0.1
pip 21.2.4
pyparsing 3.0.8
python-dateutil 2.8.2
pytz 2022.1
setuptools 61.2.0
six 1.16.0
tensorflow-model-optimization 0.7.0
torch 1.7.1
torchaudio 0.7.2
torchvision 0.8.2
typing_extensions 4.1.1
wheel 0.37.1
wincertstore 0.2

Do you have any ideas? Very Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants