GithubHelp home page GithubHelp logo

Comments (12)

panyan928 avatar panyan928 commented on July 29, 2024 1

Thank you for detailed steps. I have solved it successfully.
The key is to change the parameter num_test_images in deploy.prototxt. It must be less than the size of val data in file val.txt, otherwise it will show errors as shown above.

from ctw-baseline.

yuantailing avatar yuantailing commented on July 29, 2024

SSD prototxt is generated by ssd/ssd_hardcode/ssd_pascal_512.py. Run touch products/VGG_ILSVRC_16_layers_fc_reduced.caffemodel products/val.txt && python3 train.py and you will get everything.

Run cp ../data/annotations/downloads/train.jsonl ../data/annotations/downloads/val.jsonl ../data/annotations/ && python3 decide_cates.py and you will get products/cates.json, the map from label ID to character category.

Please let me know if you have problem using trained models.

from ctw-baseline.

panyan928 avatar panyan928 commented on July 29, 2024

I don't want to run train, I just detect images.
I have got cates.json. When I run eval.py, it shows no deploy.prototxt
F0328 06:13:51.207175 24 io.cpp:45] Check failed: fd != -1 (-1 vs. -1) File not found: products/models/SSD_512x512/deploy.prototxt

from ctw-baseline.

yuantailing avatar yuantailing commented on July 29, 2024

Run train to generate prototxt, and then CTRL+C.

from ctw-baseline.

panyan928 avatar panyan928 commented on July 29, 2024

Okay,I will try. Thank you very much.

from ctw-baseline.

panyan928 avatar panyan928 commented on July 29, 2024

Sorry, I met another problem. It needs labelmap.prototxt.

from ctw-baseline.

yuantailing avatar yuantailing commented on July 29, 2024

Call function write_caffe_labelmap, which is in ssd/prepare_train_data.py.
Sorry so many problems in the tutorial, I will update it and address all problems you met.

from ctw-baseline.

panyan928 avatar panyan928 commented on July 29, 2024

Hi, I find another problem. After run prepare_train_data.py, It shows name_size_file: "products/val_name_size.txt" in deploy.prototxt. But when test, we need test_name_size.txt, it isn't created in your code.
Maybe you can write test.py not eval.py for test if have time.

from ctw-baseline.

yuantailing avatar yuantailing commented on July 29, 2024

val_name_size.txt is only used in training steps, just touch this file. Maybe test_name_size is not necessary.

from ctw-baseline.

panyan928 avatar panyan928 commented on July 29, 2024

I didn't download your train data, so after run prepare_train_data.py, val_name_size.txt is empty.
When I run eval.py, caffe errors, as follows:
F0329 02:41:16.516167 266 detection_output_layer.cpp:98] Check failed: num_test_image_ <= names_.size() (1000 vs. 0)

So I go to check detection_output_layer

if (save_output_param.has_name_size_file()) {
string name_size_file = save_output_param.name_size_file();
if (name_size_file.empty()) {
// Ignore saving if there is no name_size_file provided.
LOG(WARNING) << "Provide name_size_file if output results to files.";
need_save_ = false;
} else {
std::ifstream infile(name_size_file.c_str());
CHECK(infile.good())
<< "Failed to open name size file: " << name_size_file;
// The file is in the following format:
// name height width
// ...
string name;
int height, width;
while (infile >> name >> height >> width) {
names_.push_back(name);
sizes_.push_back(std::make_pair(height, width));
}
infile.close();
if (save_output_param.has_num_test_image()) {
num_test_image_ = save_output_param.num_test_image();
} else {
num_test_image_ = names_.size();
}
CHECK_LE(num_test_image_, names_.size());
}
} else {
need_save_ = false;
}

It shows it needs image sizes.

from ctw-baseline.

yuantailing avatar yuantailing commented on July 29, 2024

The idea is to replace training data with an fake empty data, and produce everything you need. Here is the full solution I have tested:

  1. cp ../data/annotations/downloads/train.jsonl ../data/annotations/downloads/val.jsonl ../data/annotations/ && python3 decide_cates.py
  2. echo '{"train":[],"val":[],"test_cls":[],"test_det":[{"image_id":"0000001","file_name":"0000001.jpg"}]}' >../data/annotations/info.json
  3. head ../data/annotations/downloads/train.jsonl -n1 >../data/annotations/train.jsonl,
    head ../data/annotations/downloads/val.jsonl -n1 >../data/annotations/val.jsonl
  4. python3 prepare_train_data.py,
    touch products/VGG_ILSVRC_16_layers_fc_reduced.caffemodel && python3 train.py,
    These 2 commands will result in failure, but .prototxt you need have been generated.
  5. restore trained model to products/models/SSD_512x512/
  6. python3 prepare_test_data.py
  7. python3 eval.py
  8. python3 merge_results.py

Please let me know if you have problem with this solution.

from ctw-baseline.

findyy99 avatar findyy99 commented on July 29, 2024

Okay,I will try. Thank you very much.

can you share the deploy.prototxt to me use the google drive ? Thank you :)

from ctw-baseline.

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.