Comments (5)
I just saw your another post.
The size match happens in the convolution layers for tl_heats
and br_heats
. The sizes of weights and biases in the pretrained model are [80, 256, 1, 1]
and [80]
, which do not match your new dataset.
To prepare the model for fine-tuning on a different datasets, you can do the followings.
- In
train.py
, addnnet.save_params(0)
after line 114. This forces the code to save a randomly initialized model with correct sizes before the training starts. After the model is saved, terminate the code by Ctrl + c. - Replace the weights and biases in the trained model with the ones in the randomly initialized model. A PyTorch model is a dictionary, where the keys are the parameter names and values are the parameters. They can be loaded with
torch.load
. After loading, the parameters can be replaced bynewmodel['param_name'] = oldmodel['param_name']
. The parameter names you are looking for are:
- 'module.tl_heats.0.1.weight'
- 'module.tl_heats.0.1.bias'
- 'module.tl_heats.1.1.weight'
- 'module.tl_heats.1.1.bias'
- 'module.br_heats.0.1.weight'
- 'module.br_heats.0.1.bias'
- 'module.br_heats.1.1.weight'
- 'module.br_heats.1.1.bias'
- Save the model.
- Remove
nnet.save_params(0)
in step 1. - Add
"pretrain": "/path/to/the/pretrained/model"
in the system section of the configuration file.
from cornernet.
All you need to do is add "pretrain": "/path/to/the/pretrained/model"
in the system
section of the configuration file. The code will load the pretrained file before it starts training.
from cornernet.
Hi heilaw,
I find this function in /models/CornerNet.py, and I want to know what does the n=5 means? thank you.
class model(kp):
def init(self, db):
n = 5
dims = [256, 256, 384, 384, 384, 512]
modules = [2, 2, 2, 2, 2, 4]
out_dim = 80
super(model, self).init(
n, 2, dims, modules, out_dim,
make_tl_layer=make_tl_layer,
make_br_layer=make_br_layer,
make_pool_layer=make_pool_layer,
make_hg_layer=make_hg_layer,
kp_layer=residual, cnv_dim=256
)
from cornernet.
The number of downsamplings in each hourglass module.
from cornernet.
Hi heilaw,
If I want to change the project to python2.7, what files need to be modified? thxοΌ
from cornernet.
Related Issues (20)
- Please confirm the results
- RuntimeError: CUDNN_STATUS_MAPPING_ERROR
- when I use the corner pooling with torch 1.4, I hav got the problem
- Ground Truth Heatmap
- Can someone explain why/how does y = ids/width and x=ids%width from heatmaps ?
- Some questions about testing results
- Is heatmap binary
- A about height_inds = (br_ys < tl_ys)
- Why not predict the coordinate of the center of bounding box and regress the height and width directly? HOT 1
- Some questions about python train.py CornerNet
- train it on custom dataset HOT 2
- How to convert. Pkl weight file to torch script format
- Warning when used cornerpooling in a model HOT 1
- How to compile Corner Pooling Layers on windows? HOT 1
- bug in ae_loss HOT 1
- RuntimeError: unable to write to file </torch_5845_4138295531>
- #
- [W Indexing.cu:937] Warning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead. (function masked_fill__cuda) HOT 2
- error
- cornor pool make error
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 cornernet.