Giter VIP home page Giter VIP logo

Comments (9)

heilaw avatar heilaw commented on August 19, 2024 2
  1. Run python train.py CornerNet_Saccade --initialize to generate a randomly initialized model, which will be saved to cache/nnet/CornerNet_Saccade/CornerNet_Saccade_0.pkl.
  2. Copy the parameters from the trained model to randomly initialized model except the {tl,br}_heats layers. The model is a Python dictionary where the keys are the parameter names and the values are the parameters. So you can easily filter out the parameters for the {tl,br}_heats layers.
  3. Save the model as CornerNet_Saccade_pretrained.pkl
  4. Add "pretrain": "/path/to/your/pretrained/model" in the db section of configs/CornerNet_Saccade.json.
  5. Start the training python train.py CornerNet_Saccade.

You may want to checkout the save and load functions in PyTorch.

from cornernet-lite.

pingqi avatar pingqi commented on August 19, 2024 1

@VCBE123 @heilaw
how to copy the param from one A pkl to another B pkl?The process is only forward? when get the B pkl ,then using train.py to train?

  1. Copy the parameters from the trained model to randomly initialized model except the {tl,br}_heats layers. The model is a Python dictionary where the keys are the parameter names and the values are the parameters. So you can easily filter out the parameters for the {tl,br}_heats layers.

from cornernet-lite.

jerryxucheng avatar jerryxucheng commented on August 19, 2024

@VCBE123 I'm a new comer in machine learning. May I ask where to modify in the coco.py to adapt the model to a dataset with different numbers of categories?

from cornernet-lite.

ray-lee-94 avatar ray-lee-94 commented on August 19, 2024

@VCBE123 I'm a new comer in machine learning. May I ask where to modify in the coco.py to adapt the model to a dataset with different numbers of categories?

you need to change "_coco_cls_ids", "_coco_cls_names",and the path to your dataset

from cornernet-lite.

jerryxucheng avatar jerryxucheng commented on August 19, 2024

@VCBE123 I have already changed ids and names. The question is that the dataset is generated by label me, which gives me hundreds of json files. When I point to a certain json file, there is an error:
Traceback (most recent call last):
File "train.py", line 249, in
main(None, ngpus_per_node, args)
File "train.py", line 220, in main
training_dbs = [datasets[dataset](config["db"], split=train_split, sys_config=system_config) for _ in range(workers)]
File "train.py", line 220, in
training_dbs = [datasets[dataset](config["db"], split=train_split, sys_config=system_config) for _ in range(workers)]
File "/home/deepvision/xc/CornerNet-Lite/core/dbs/coco.py", line 49, in init
self._detections, self._eval_ids = self._load_coco_annos()
File "/home/deepvision/xc/CornerNet-Lite/core/dbs/coco.py", line 59, in _load_coco_annos
class_ids = coco.getCatIds()
File "/home/deepvision/anaconda3/lib/python3.6/site-packages/pycocotools/coco.py", line 170, in getCatIds
cats = self.dataset['categories']
KeyError: 'categories'
So how to solve the problem? Thank you a lot.

from cornernet-lite.

ray-lee-94 avatar ray-lee-94 commented on August 19, 2024

You need to format your dataset to the coco-stytle.

from cornernet-lite.

gtwell avatar gtwell commented on August 19, 2024

how to use pascal_voc dataset training?

from cornernet-lite.

cwjhx avatar cwjhx commented on August 19, 2024
  1. Run python train.py CornerNet_Saccade --initialize to generate a randomly initialized model, which will be saved to cache/nnet/CornerNet_Saccade/CornerNet_Saccade_0.pkl.
  2. Copy the parameters from the trained model to randomly initialized model except the {tl,br}_heats layers. The model is a Python dictionary where the keys are the parameter names and the values are the parameters. So you can easily filter out the parameters for the {tl,br}_heats layers.
  3. Save the model as CornerNet_Saccade_pretrained.pkl
  4. Add "pretrain": "/path/to/your/pretrained/model" in the db section of configs/CornerNet_Saccade.json.
  5. Start the training python train.py CornerNet_Saccade.

You may want to checkout the save and load functions in PyTorch.

I don't understand here:
2. Copy the parameters from the trained model to randomly initialized model except the {tl,br}_heats layers. The model is a Python dictionary where the keys are the parameter names and the values are the parameters. So you can easily filter out the parameters for the {tl,br}_heats layers.

from cornernet-lite.

cwjhx avatar cwjhx commented on August 19, 2024

@VCBE123 I'm a new comer in machine learning. May I ask where to modify in the coco.py to adapt the model to a dataset with different numbers of categories?

you need to change "_coco_cls_ids", "_coco_cls_names",and the path to your dataset

【 "categories": 80,】 in the db section of configs/CornerNet_Saccade.json。Do you need to change?

from cornernet-lite.

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.