华为计算微信公众号
昇腾AI开发者公众号
华为计算微博
华为计算今日头条
def run_export():
def run_export(): context.set_context(mode=context.GRAPH_MODE, device_target=config.device_target) if config.device_target == "Ascend": context.set_context(device_id=config.device_id) ts_shape = config.testing_shape network = YOLOV4CspDarkNet53() network.set_train(False) param_dict = load_checkpoint(config.ckpt_file) load_param_into_net(network, param_dict) input_data = Tensor(np.ones([config.batch_size, 3, ts_shape, ts_shape]), mindspore.float32) export(network, input_data, file_name=config.file_name, file_format=config.file_format)
config.batch_size = -1时报错: ValueError: negative dimensions are not allowed 错误提示应该是不支持负数,请问该如何导出动态bs的air模型呢
我要发帖子
def run_export():
def run_export(): context.set_context(mode=context.GRAPH_MODE, device_target=config.device_target) if config.device_target == "Ascend": context.set_context(device_id=config.device_id) ts_shape = config.testing_shape network = YOLOV4CspDarkNet53() network.set_train(False) param_dict = load_checkpoint(config.ckpt_file) load_param_into_net(network, param_dict) input_data = Tensor(np.ones([config.batch_size, 3, ts_shape, ts_shape]), mindspore.float32) export(network, input_data, file_name=config.file_name, file_format=config.file_format)config.batch_size = -1时报错:
ValueError: negative dimensions are not allowed
错误提示应该是不支持负数,请问该如何导出动态bs的air模型呢