forked from mindspore-Ecosystem/mindspore
fix maskrcnn and fasterrcnn 310 bug
This commit is contained in:
parent
52730382b2
commit
d0be1353c3
|
@ -169,7 +169,15 @@ int AclProcess::WriteResult(const std::string& imageFile) {
|
|||
std::cout << "open result file " << outFileName << " failed" << std::endl;
|
||||
return INVALID_POINTER;
|
||||
}
|
||||
fwrite(resHostBuf, output_size, sizeof(char), outputFile);
|
||||
size_t size = fwrite(resHostBuf, sizeof(char), output_size, outputFile);
|
||||
if (size != output_size) {
|
||||
fclose(outputFile);
|
||||
outputFile = nullptr;
|
||||
std::cout << "write result file " << outFileName << " failed, write size[" << size <<
|
||||
"] is smaller than output size[" << output_size << "], maybe the disk is full." << std::endl;
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
fclose(outputFile);
|
||||
outputFile = nullptr;
|
||||
} catch (std::exception &e) {
|
||||
|
|
|
@ -169,7 +169,14 @@ int AclProcess::WriteResult(const std::string& imageFile) {
|
|||
std::cout << "open result file " << outFileName << " failed" << std::endl;
|
||||
return INVALID_POINTER;
|
||||
}
|
||||
fwrite(resHostBuf, output_size, sizeof(char), outputFile);
|
||||
size_t size = fwrite(resHostBuf, sizeof(char), output_size, outputFile);
|
||||
if (size != output_size) {
|
||||
fclose(outputFile);
|
||||
outputFile = nullptr;
|
||||
std::cout << "write result file " << outFileName << " failed, write size[" << size <<
|
||||
"] is smaller than output size[" << output_size << "], maybe the disk is full." << std::endl;
|
||||
return ERROR;
|
||||
}
|
||||
fclose(outputFile);
|
||||
outputFile = nullptr;
|
||||
} catch (std::exception &e) {
|
||||
|
|
Loading…
Reference in New Issue