-
Notifications
You must be signed in to change notification settings - Fork 67
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
win_python_keras版本加载模型时报错 #19
Comments
@xdqf2128 我按照你的代码尝试复现,但我得机器环境下是执行成功的。 我看到你的错误是 P.S. 如果 Buid 成功了,注意在推理的时候,输入需要类型转换一下,要不然 numpy randn 生成的默认不是 float32 的数据,会无法通过输入数据校验。 |
@yuanzexi 我按照您说的把LOGGING设为了ON |
@yuanzexi 我注意到报错是在trt_keras_parser.cpp(90),然后查看了源码,发现是判断模型是否为空,并检查class_name。这里我就想到了新版keras模型的class_name是Functional不是老版的Model,所以我直接替换成了老版本的模型,并添加了日志打印。 |
@yuanzexi 我注意到tf1.12的模型中BN并不带V1,所以用不带V1的模型试了下,成功完成了build,并且推理成功 |
简单测试时报错
步骤如下:
1.先用keras保存resnet50的预训练模型
2.按照示例,运行
报错如下:
加载模型那一步失败了,还望指导下,感谢~
Environment
TensorRT Version: 7.2.1.6
NVIDIA GPU: RTX 2080 SUPER
NVIDIA Driver Version: 441.22
CUDA Version: 10.2
CUDNN Version: 8.2.0.53
Operating System: Windows 10 专业版
Python Version: 3.8.5
Keras: 2.4.3
h5py: 2.10.0
The text was updated successfully, but these errors were encountered: