Comments (6)
对于彩色的图片确实是这个问题,我改了一下,没有报错了,但是识别不出来内容,不知道是模型的问题,还是改的问题。
这个错误的原因应该是图片要 reshape 后传入模型,因为图片的shape 是 h, w, channel, 模型要求的是 channel, h, w。
我的代码改动如下,可以作为参考:
在 __init__.py
的 classification
方法,第 1635 行增加以下代码
if self.__channel == 3:
image = np.asarray(image).astype(np.float32)
old_shape = image.shape
image = image.reshape(old_shape[0], old_shape[3], old_shape[1], old_shape[2])
ort_inputs = {'input1': image}
else:
ort_inputs = {'input1': np.array([image]).astype(np.float32)}
from dddd_trainer.
请问问题解决了吗,我也遇到了
from dddd_trainer.
遇到了同样的问题,没解决
from dddd_trainer.
对于彩色的图片确实是这个问题,我改了一下,没有报错了,但是识别不出来内容,不知道是模型的问题,还是改的问题。 这个错误的原因应该是图片要 reshape 后传入模型,因为图片的shape 是 h, w, channel, 模型要求的是 channel, h, w。
我的代码改动如下,可以作为参考:
在
__init__.py
的classification
方法,第 1635 行增加以下代码if self.__channel == 3: image = np.asarray(image).astype(np.float32) old_shape = image.shape image = image.reshape(old_shape[0], old_shape[3], old_shape[1], old_shape[2]) ort_inputs = {'input1': image} else: ort_inputs = {'input1': np.array([image]).astype(np.float32)}
试了,没报错,但是不能识别
from dddd_trainer.
INVALID_ARGUMENT : Invalid rank for input: input1 Got: 5 Expected: 4 Please fix either the inputs or the model
请问解决了吗
from dddd_trainer.
感谢
在 ort_outs = self.__ort_session.run(None, ort_inputs) 前面加上你的判断就可以了
from dddd_trainer.
Related Issues (20)
- 有可以提供参考的训练时长吗 HOT 3
- 清晰空心数字无法识别 HOT 2
- 是否支持滑块验证码学习? HOT 4
- 导出时报错:TypeError: export() got an unexpected keyword argument '_retain_param_name'
- CtrlC中断训练后,重新执行训练命令后报错
- 请问CPU训练只有阶段数据没有模型数据为何 HOT 2
- 能放出来同花顺客户端训练的权重吗?
- 这个报错是啥意思 HOT 2
- 因磁盘满而中断后,无法自动恢复 HOT 1
- Mac也是按这个步骤来吗,改成CPU训练就可以了嘛 HOT 6
- 电脑是2060显卡能搞吗 HOT 4
- 断点恢复训练问题
- 学习素材怎么准备 HOT 2
- 可以提供坐标点选的训练吗 HOT 1
- 将ddddocr换成其他CNN比如mobilenetv2会变成NAN
- 训练了一天英文数字验证码,正确率真的感人,是我电脑不行吗....
- 训练测试集一段时间报错
- StopIteration 問題
- 希望能出一版colab上可以运行的ipynb代码
- acc准确率始终是0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dddd_trainer.