Comments (12)
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.
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.
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.
Run train to generate prototxt, and then CTRL+C.
from ctw-baseline.
Okay,I will try. Thank you very much.
from ctw-baseline.
Sorry, I met another problem. It needs labelmap.prototxt.
from ctw-baseline.
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.
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.
val_name_size.txt
is only used in training steps, just touch this file. Maybe test_name_size is not necessary.
from ctw-baseline.
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.
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:
cp ../data/annotations/downloads/train.jsonl ../data/annotations/downloads/val.jsonl ../data/annotations/ && python3 decide_cates.py
echo '{"train":[],"val":[],"test_cls":[],"test_det":[{"image_id":"0000001","file_name":"0000001.jpg"}]}' >../data/annotations/info.json
head ../data/annotations/downloads/train.jsonl -n1 >../data/annotations/train.jsonl
,
head ../data/annotations/downloads/val.jsonl -n1 >../data/annotations/val.jsonl
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.- restore trained model to
products/models/SSD_512x512/
python3 prepare_test_data.py
python3 eval.py
python3 merge_results.py
Please let me know if you have problem with this solution.
from ctw-baseline.
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)
- Some question about test in detection HOT 1
- Error on CodaLab (CTW dataset classification) HOT 2
- Dataset weiyun download link failed. HOT 4
- Question when running detection_perf.py HOT 3
- Quenstion about total detection procedure HOT 8
- restore the weight of Inception_v4 HOT 6
- 检测的时候怎么提取一行字符或者一列的区域 yolo例子下面那个只能提取单个字符的区域 HOT 5
- Where can I locate the 'learning' module? HOT 2
- Very slow training speed. Is this expected for my system setup? HOT 4
- How to deal with negative values in the coordinates of polygon regions HOT 1
- images-test miss some images HOT 2
- 使用yolov3算法需要在哪些方面做出调整呢 HOT 4
- 您好,请问在训练和测试的时候裁剪图片是如何裁剪的? HOT 1
- 有人有训练好的模型吗
- 如何将jsonl格式的注释转换为txt格式?
- Aspect ratio of the anchor boxes HOT 2
- 请问您在原始yolov2基础上修改了哪些东西,如果换成Yolov3该怎么去修改呢 HOT 1
- 如何获取行文本图像和标签? HOT 2
- Problem when reproducing the classification performance HOT 2
- Problem of CodaLab 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 ctw-baseline.