uTensor / utensor-mnist-demo

Apache License 2.0
20 stars 25 forks source link

What is the current status? #6

Open aoowweenn opened 6 years ago

aoowweenn commented 6 years ago

I have used DISCO_F413ZH to try to reproduce this demo but it failed. By commit https://github.com/uTensor/utensor-mnist-demo/commit/da6615e0dff628e86b40363867f3948691c37961, here is what I got:

In main.cpp, get_deep_mlp_ctx function does not match get_quant_model_ctx in models/deep_mlp.hpp

Running tensorflow-models/deep_mlp.ipynb is OK but utensor-cli --output-nodes=OutputLayer/y_pred tensorflow-models/mnist_model/deep_mlp.pb Output:

AssertionError: OutputLayer/y_pred is not in graph

So I tried: utensor-cli tensorflow-models/mnist_model/deep_mlp.pb and passed. idx files will be like constants/deep_mlp/*.idx

Then copy constants folder to micro SD card and insert it to the board cp constants /media/${USERNAME}/${SD_DEVICE} -r And, mbed deploy mbed compile -m DISCO_F413ZH -t GCC_ARM --profile=uTensor/build_profile/release.json -f -c

After flashing the board, from CoolTerm output:

.program start...
Done padding

Reshaping

Creating Graph

[Error] ./uTensor/uTensor/loaders/tensorIdxImporter.cpp:61 @parseMeta Error opening file: /fs/constants/deep_mlp/Layer1_MatMul_eightbit_x_reshape_dims_0.idx

When I try to use Debug string vim uTensor/uTensor/util/uTensor_util.hpp Move enum Padding out of #if #endif block vim mbed_app.json Set the debug-msg value to “1”

Compile again and flash mbed compile -m DISCO_F413ZH -t GCC_ARM --profile=uTensor/build_profile/release.json -f -c

Output:
program start...
 * SDBlockDevice init   [DONE]
 * Mounting the filesystem on "/fs".  [**Failure**] -2
Exiting…

Any ideas? My 2GB micro SD card is formatted to FAT32.

neil-tan commented 6 years ago

Hey! Thanks for bringing this to our attention. The last know-to-work commit is 78a2704d65ef714bfe2bbdbdb3fb5175c4b124bb.

@mbartling yo, mind having a look at this?

mbartling commented 6 years ago

Hi @aoowweenn, thanks for pointing this out. It should be fixed in the latest commit. I went ahead and simplified the utensor-cli command in the README to:

&> utensor-cli tensorflow-models/mnist_model/deep_mlp.pb

https://github.com/uTensor/utensor-mnist-demo/commit/64b84290f23913c411cf20958bbae7f8695fdac1

Can you try rerunning for me? Also, make sure the SD card is all the way in and not set to locked. pretty sure a bad connection is causing the mount error.

mbartling commented 6 years ago

@dboyliao I think the output nodes error might be a bug in the code gen. I will take a look at this later

mbartling commented 6 years ago

@aoowweenn, Can you check to see if it works now? I made some changes to master to make it a bit more stable. You should probably run through this from scratch FYI.

aoowweenn commented 6 years ago

@neil-tan @mbartling , Thanks a lot! it works now and can really recognize my hand writing. For the file system error, I just used another 16GB micro SD card without problems. The log:

uTensor deep learning character recognition demo https://github.com/uTensor/utensor-mnist-demo Draw a number (0-9) on the touch screen, and press the button... Done padding Reshaping Creating Graph Evaluating Number guessed 4 [Error] ./uTensor/uTensor/core/tensor.hpp:78 @allocate ran out of memory for 230400 malloc

Is that allocation error normal?