A question about fine-tuning
I am very interested in this project, and I have few questions, does anybody can help me?
1. What is the relationship between painter and SegGPT?
2. If I want to fine tune SegGPT on my own dataset, are there any suggestions?
3. And can author provide a script similar to Painter for developers to verify and use ?
比如我给打上日志
void FD_C_DestroyDetectionResult(
__fd_take FD_C_DetectionResult* fd_c_detection_result) {
if (fd_c_detection_result == nullptr)
return;
std::cout<<"5"<<std::endl;
// delete boxes
for (size_t i = 0; i < fd_c_detection_result->boxes.size; i++) {
delete[] fd_c_detection_result->boxes.data[i].data;
}
delete[] fd_c_detection_result->boxes.data;
std::cout<<"6"<<std::endl;
// delete rotated_boxes
for (size_t i = 0; i < fd_c_detection_result->rotated_boxes.size; i++) {
delete[] fd_c_detection_result->rotated_boxes.data[i].data;
}
delete[] fd_c_detection_result->rotated_boxes.data;
std::cout<<"7"<<std::endl;
// delete scores
delete[] fd_c_detection_result->scores.data;
std::cout<<"8"<<std::endl;
// delete label_ids
delete[] fd_c_detection_result->label_ids.data;
std::cout<<"9"<<std::endl;
// delete masks
for (size_t i = 0; i < fd_c_detection_result->masks.size; i++) {
delete[] fd_c_detection_result->masks.data[i].data.data;
delete[] fd_c_detection_result->masks.data[i].shape.data;
}
delete fd_c_detection_result;
std::cout<<"10"<<std::endl;
}
日志信息如下:
5
6
7
8
9
10
5
6
7
8
9
error: process didn't exit successfully
这个倒没遇到过,可以检查下看是否出现重复delete了?
这个倒没遇到过,可以检查下看是否出现重复delete了?
void FD_C_DestroyDetectionResult(
__fd_take FD_C_DetectionResult* fd_c_detection_result) {
if (fd_c_detection_result == nullptr) return;
// delete boxes
for (size_t i = 0; i < fd_c_detection_result->boxes.size; i++) {
delete[] fd_c_detection_result->boxes.data[i].data;
}
delete[] fd_c_detection_result->boxes.data;
// delete scores
delete[] fd_c_detection_result->scores.data;
// delete label_ids
delete[] fd_c_detection_result->label_ids.data;
// delete masks
for (size_t i = 0; i < fd_c_detection_result->masks.size; i++) {
delete[] fd_c_detection_result->masks.data[i].data.data;
delete[] fd_c_detection_result->masks.data[i].shape.data;
}
delete fd_c_detection_result;
}
void FD_C_DestroyOneDimDetectionResult(
__fd_take FD_C_OneDimDetectionResult* fd_c_one_dim_detection_result) {
for (int i = 0; i < fd_c_one_dim_detection_result->size; i++) {
FD_C_DestroyDetectionResult(fd_c_one_dim_detection_result->data + i);
}
delete[] fd_c_one_dim_detection_result->data;
delete fd_c_one_dim_detection_result;
}
如果在FD_C_DestroyOneDimDetectionResult调用这个释放的子函数FD_C_DestroyDetectionResult,只要删掉FD_C_DestroyDetectionResult 里面的delete fd_c_detection_result;这一行就不会报错了,因为fd_c_one_dim_detection_result->data是用new[]开辟的内存,如果子函数中执行的delete fd_c_detection_result;就和new[]的方法不匹配,只需要在delete[] fd_c_one_dim_detection_result->data这一句就行,但是FD_C_DetectionResult调用FD_C_DetectionResult的函数没法释放fd_c_detection_result本身,最后导致单独释放DetectionResult和OneDimDetectionResult中调用FD_C_DestroyDetectionResult的行为不一致。我看到里面还有很多类似TwoDimArrayFloat,TneDimArrayInt32 等类似的结构在释放的时候可能存在问题,我也没具体去试到底哪里出问题了,但是我在用的时候有时候会出现崩溃的问题,这个问题主要还是集中在模型的batch_predict的问题上,想调用batch_predict就存在创建OneDimDetectionResult,然后释放OneDimDetectionResult就很容易出问题,不知道官方是不是能完善一下这些问题哦?