Comments (14)
Your model train by pytorch0.3.x, but run in pytorch > 0.4.0.
Change the parameter of BatchNorm2d by yourself.
For example, define the function
def recursion_change_bn(module):
if isinstance(module, torch.nn.BatchNorm2d):
module.track_running_stats = 1
else:
for i, (name, module1) in enumerate(module._modules.items()):
module1 = recursion_change_bn(module1)
return module
and
use it when you load model
check_point = torch.load(check_point_file_path)
model = check_point['net']
for i, (name, module) in enumerate(model._modules.items()):
module = recursion_change_bn(model)
model.eval()
I have ran 0.3.1 model in pytorch0.4.1 and pytorch1.0.0.
you can use this way to update you model from 0.3.x to 0.4+
from pytorch-pose-hg-3d.
A working solution is to load the state_dict of the model with argument "strict=False".
Example code as below:
ckpt = torch.load(model_path)
model = Model(model_args)
model.load_state_dict(ckpt.state_dict(), strict=False)
model.eval()
from pytorch-pose-hg-3d.
In the mean time i started training the model myself on the dataset with python3 and pytorch 0.5. I can load the model and do the forward pass without getting the track_running_stats missing error.
from pytorch-pose-hg-3d.
"train_params = [x for x in model.parameters() if x.requires_grad] "
It works.
from pytorch-pose-hg-3d.
In the mean time i started training the model myself on the dataset with python3 and pytorch 0.5. I can load the model and do the forward pass without getting the track_running_stats missing error.
Hi,
I'am using torch version 0.4 and i get that error, can you tell how to solve this problem,thanks.
from pytorch-pose-hg-3d.
The Problem is that higher torch versions use the attribute track_running_stats. But track_runninh_stats is a new attribute and by the time this model was trained it was not available. So you try loading a model without this Attribute with a pytorch version that needs that attribute. I couldn’t find a way to add this attribute to the already trained model that is why I trained my own model with a higher pytorch version so that the model includes the attribute. Hope I could help
from pytorch-pose-hg-3d.
pytorch 0.3.1 works well on my computer. My configuration is Ubuntu 16.04, cuda 9.0, pytroch 0.3.1, python 2.7.15.
from pytorch-pose-hg-3d.
I am facing the same problem ...is any can help me
from pytorch-pose-hg-3d.
I believe you need to manually download an older version of pytorch like 0.3.0 or 0.3.1
from pytorch-pose-hg-3d.
Hi,
The current version should work on python3 and pytorch 0.4+
from pytorch-pose-hg-3d.
@heroinlin : I added the above code and a new error creeped in:
File "/home/chandini/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 535, in getattr
type(self).name, name))
AttributeError: 'Upsample' object has no attribute 'name'
I couldn't find any leads on this in google search.
Any suggestions please ?
from pytorch-pose-hg-3d.
@chanduKichu I have met the same problem. Did you solve it?
from pytorch-pose-hg-3d.
@chandiniRNair @wuzb19951013 I have the same error. Were you able to figure it out ?
from pytorch-pose-hg-3d.
I got the error:
AttributeError: 'Upsample' object has no attribute 'align_corners'
There is no answer to my error on google.
But I try to modify the lib\site-packages\torch\nn\modules\upsampling.py", line 141
:
def forward(self, input: Tensor) -> Tensor:
return F.interpolate(input, self.size, self.scale_factor, self.mode)#self.align_corners
It works...
Hope it helps someone encounter the same error, but please correct me if I am doing the wrong way out.
from pytorch-pose-hg-3d.
Related Issues (20)
- s = min(s, max(img.shape[0], img.shape[1])) * 1.0 AttributeError: 'NoneType' object has no attribute 'shape' HOT 4
- Confidence of Detected Joints
- The defination in dataset file
- h36m benchmark result for categories
- Stage1: 2D pre-trained model trained to epoch=0?
- about the permission of pre-processed Human3.6M dataset
- about the pre-processed of Human3.6M
- RUN ERROR
- Performance On MPI-INF Dataset
- The preprocess of mpii is incorrect when input_h!=input_w
- The src point is wrong in image.py
- some problems occur running demo HOT 2
- the model behave worse when detect the squat
- download the models HOT 2
- 段错误,核心已转储 HOT 1
- how to using the camera of my own pc??
- root joint
- I solved 。。。
- Is it possible to input 2D coordinates obtained by other methods to obtain 3D coordinates in your model?
- demo has error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-pose-hg-3d.