!7229 fix nasnet mstype

Merge pull request !7229 from panfengfeng/fix_nasnet_mstype
This commit is contained in:
mindspore-ci-bot 2020-10-13 17:07:33 +08:00 committed by Gitee
commit 416e57be12
2 changed files with 7 additions and 1 deletions

View File

@ -214,7 +214,12 @@ static Status JpegReadScanlines(jpeg_decompress_struct *const cinfo, int max_sca
std::vector<JSAMPLE> scanline(scanline_size);
JSAMPLE *scanline_ptr = &scanline[0];
while (cinfo->output_scanline < static_cast<unsigned int>(max_scanlines_to_read)) {
int num_lines_read = jpeg_read_scanlines(cinfo, &scanline_ptr, 1);
int num_lines_read = 0;
try {
num_lines_read = jpeg_read_scanlines(cinfo, &scanline_ptr, 1);
} catch (std::runtime_error &e) {
RETURN_STATUS_UNEXPECTED("jpeg_read_scanlines error.");
}
if (cinfo->out_color_space == JCS_CMYK && num_lines_read > 0) {
for (int i = 0; i < crop_w; ++i) {
int cmyk_pixel = 4 * i + offset;

View File

@ -25,6 +25,7 @@ from mindspore.train.callback import ModelCheckpoint, CheckpointConfig, LossMoni
from mindspore.train.model import Model
from mindspore.train.serialization import load_checkpoint, load_param_into_net
from mindspore.common import set_seed
from mindspore.common import dtype as mstype
from src.config import nasnet_a_mobile_config_gpu as cfg
from src.dataset import create_dataset