Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

MXPredCreate lost dtype #13335

Closed
yajiedesign opened this issue Nov 20, 2018 · 4 comments
Closed

MXPredCreate lost dtype #13335

yajiedesign opened this issue Nov 20, 2018 · 4 comments

Comments

@yajiedesign
Copy link
Contributor

Description

when use MXPredCreate with int8.it will Type inconsistent error.
I find https://github.com/apache/incubator-mxnet/blob/master/src/c_api/c_predict_api.cc#L213 cause data dtype to lose.And then cause Type inconsistent.

Environment info (Required)

----------Python Info----------
Version : 3.6.0
Compiler : MSC v.1900 64 bit (AMD64)
Build : ('default', 'Dec 23 2016 11:57:41')
Arch : ('64bit', 'WindowsPE')
------------Pip Info-----------
Version : 18.1
Directory : D:\Anaconda3\lib\site-packages\pip
----------MXNet Info-----------
Version : 1.3.1
Directory : G:\deeplearn\mxnet\python\mxnet
Hashtag not found. Not installed from pre-built package.
----------System Info----------
Platform : Windows-10-10.0.17134-SP0
system : Windows
node : DEVEGA
release : 10
version : 10.0.17134

Package used (Python/R/Scala/Julia):C api

Build info (Required if built from source)

Compiler (gcc/clang/mingw/visual studio):visual studio

MXNet commit hash:
017941e

Build config:

Error Message:

Type inconsistent, Provided = float32, inferred type = int8

Minimum reproducible example

` std::string json_file = "int8-symbol.json";
std::string param_file = "int8-0000.params";
BufferFile json_data(json_file);
BufferFile param_data(param_file);

mx_uint num_input_nodes = 1;
const char* input_key[1] = { "data" };
const char** input_keys = input_key;

const mx_uint input_shape_indptr[2] = { 0,4 };
const mx_uint input_shape_data[4] = { 1,static_cast<mx_uint>(3) ,static_cast<mx_uint>(1080),static_cast<mx_uint>(1920) };

PredictorHandle pred_hnd = 0;

int dev_type = 1;
int dev_id = 1;

MXPredCreate(
static_cast<const char*>(json_data.GetBuffer()),
static_cast<const char*>(param_data.GetBuffer()),
static_cast(param_data.GetLength()),
dev_type,
dev_id,
num_input_nodes,
input_keys,
input_shape_indptr,
input_shape_data,
&pred_hnd);
`

@vdantu
Copy link
Contributor

vdantu commented Nov 20, 2018

@mxnet-label-bot add [C Api, Bug]

kice added a commit to kice/incubator-mxnet that referenced this issue Nov 22, 2018
@piyushghai
Copy link
Contributor

@kice You seemed to have found a workaround to the problem. Can you add the fix back into apache/incubator-mxnet repo through a pull request ?

@anirudh2290
Copy link
Member

This is related to #14159 . I am working on fixing this.

@anirudh2290
Copy link
Member

Resolved by #15245

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants