Skip to content
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

关于数据输入的问题 #314

Closed
DmrfCoder opened this issue Mar 28, 2018 · 2 comments
Closed

关于数据输入的问题 #314

DmrfCoder opened this issue Mar 28, 2018 · 2 comments

Comments

@DmrfCoder
Copy link

问题描述:
需要对结构化数据进行预测,之前使用caffe训练的时候是把txt文件中的数据读出来写到LMDB中然后进行训练,对应维度是2×8×550,即初始化了一个数组a[2][8][550],将三维数组直接转化为LMDB,那么对应到ncnn的Mat时由于Mat的数据输入只有一个一维的*data,此时应该如何将2×8×550的数据转化到一维?应该按照c->h->w还是h->w->c?

@nihui
Copy link
Member

nihui commented Mar 28, 2018

a[2][8][550] c=2 h=8 w=550
那么就是 Mat m(550 * 8 * 2, a);
m = m.reshape(550, 8, 2);

@DmrfCoder
Copy link
Author

@nihui 搞定了,谢谢大佬的指教!!

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

No branches or pull requests

2 participants