You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
}
The text was updated successfully, but these errors were encountered:
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;
}
The text was updated successfully, but these errors were encountered: