8000 20181224版本,无法读入转换后的模型的问题。 · Issue #732 · Tencent/ncnn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

20181224版本,无法读入转换后的模型的问题。 #732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ningxiner1001 opened this issue Dec 28, 2018 · 3 comments
Closed

20181224版本,无法读入转换后的模型的问题。 #732

ningxiner1001 opened this issue Dec 28, 2018 · 3 comments
Labels

Comments

@ningxiner1001
Copy link

template bool readValue(T & val, FILE * fp)
{
size_t res = fread(&val, sizeof(T), 1, fp);
if (res != sizeof(T)) {
fprintf(stderr, "issue with param file reading\n");
return false;
}
return true;
}

int Net::load_param_bin(FILE* fp)
{
int magic = 0;
if (!readValue(magic, fp))
return -1;
if (magic != 7767517)
{
fprintf(stderr, "param is too old, please regenerate\n");
return -1;
}
...
}

上述代码中以下是否有问题,res=1,sizeof(T)=4,return false,导致模型无法读入,@nihui 求帮助。
size_t res = fread(&val, sizeof(T), 1, fp);
if (res != sizeof(T)) {
fprintf(stderr, "issue with param file reading\n");
return false;
}

@nihui nihui added the bug label Dec 28, 2018
@nihui
Copy link
Member
nihui commented Dec 28, 2018

真是个 bug ...

@nihui nihui closed this as completed in 0991893 Dec 28, 2018
@nihui
Copy link
Member
nihui commented Dec 28, 2018

已重新tag发布新版本 :)

@ningxiner1001
Copy link
Author

谢谢大神,向大神学习!

jiangwch added a commit to jiangwch/ncnn that referenced this issue Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0