ghjeon
ghjeon

Reputation: 21

How can I solve the Problem during Mbed compile?(depthwise_conv.cc)

I'm studying about machine learning using tinyML book. I'm trying to Mbed compile, but it is not working. The problem situations is the following:

The book proposes the following process.

make -f tensorflow/lite/micro/tools/make/Makefile \
TARGET=mbed TAGS="cmsis-nn disco_f746ng" generate_micro_speech_mbed_project

Chage the directory.

cd tensorflow/lite/micro/tools/make/gen/mbed_cortex-m4/prj/micro_speech/mbed

Configure the Mbed poject root.

mbed config root .

Mbed deploy

mbed deploy

Modify the Mbed configuration file to use C++11.

python3 -c 'import fileinput, glob;
for filename in glob.glob("mbed-os/tools/profiles/*.json"):
    for line in fileinput.input(filename, inplace=True):
        print(line.replace("\"-std=gnu++98\"","\"-std=c++11\", \"-fpermissive\""))'

And compile

mbed compile -m DISCO_F746NG -t GCC_ARM

But, there are some problems in process of deploy. During the deployment process, a problem occurred. While looking for a solution, I found a suggestion to modify the make command as follows.

make -f tensorflow/lite/micro/tools/make/Makefile \
TARGET=mbed TAGS="CMSIS-NN disco_f746ng" generate_micro_speech_mbed_project

After making the modification, I went through the compile process in the same manner, but encountered the following errors.

Compile [ 82.7%]: depthwise_conv.cc
[Error] depthwise_conv.cc@178,9: invalid conversion from 'int' to 'const cmsis_nn_dims*' [-fpermissive]
[Error] depthwise_conv.cc@178,22: invalid conversion from 'int' to 'const cmsis_nn_dims*' [-fpermissive]
[Error] depthwise_conv.cc@178,49: too many arguments to function 'int32_t arm_depthwise_conv_s8_opt_get_buffer_size(const cmsis_nn_dims*, const cmsis_nn_dims*)'
[Error] depthwise_conv.cc@184,34: cannot convert 'const signed char*' to 'const cmsis_nn_context*'
[Error] depthwise_conv.cc@195,9: 'ARM_MATH_SUCCESS' was not declared in this scope; did you mean 'ARM_MATH_DSP'?
[Error] depthwise_conv.cc@184,34: cannot convert 'const signed char*' to 'const cmsis_nn_context*'
[Error] depthwise_conv.cc@200,34: cannot convert 'const signed char*' to 'const cmsis_nn_context*'
[Error] depthwise_conv.cc@212,9: 'ARM_MATH_SUCCESS' was not declared in this scope; did you mean 'ARM_MATH_DSP'?
[Error] depthwise_conv.cc@200,34: cannot convert 'const signed char*' to 'const cmsis_nn_context*'
[Error] depthwise_conv.cc@272,5: 'arm_depthwise_conv_u8_basic_ver1' was not declared in this scope; did you mean 'arm_depthwise_conv_fast_s16'?
[ERROR] '_queue.SimpleQueue' object has no attribute 'queue'
[mbed] ERROR: "/usr/bin/python3" returned error.
       Code: 1
       Path: "/home/ghjeon/tensorflow-lite/tensorflow/lite/micro/tools/make/gen/mbed_cortex-m4/prj/micro_speech/mbed"
       Command: "/usr/bin/python3 -u /home/ghjeon/tensorflow-lite/tensorflow/lite/micro/tools/make/gen/mbed_cortex-m4/prj/micro_speech/mbed/mbed-os/tools/make.py -t GCC_ARM -m DISCO_F746NG --source . --build ./BUILD/DISCO_F746NG/GCC_ARM"
       Tip: You could retry the last command with "-v" flag for verbose output
---

I cannot solve this problem. I have been unable to solve this problem for 2 days. I am thankful in advance to anyone who can help.

[ERROR] '_queue.SimpleQueue' object has no attribute 'queue'

I have seen information suggesting that the above errors can be resolved by using Python 2.7. However, I am not sure if this would allow the use of CLI1. Because ARM suggests that CLI1 need Python 3.7.x version.

Upvotes: 1

Views: 33

Answers (0)

Related Questions