Giter VIP home page Giter VIP logo

pulp-dronet's Introduction

PULP-DroNet: Judge me by my size, do you? --Yoda, TESB

Authors: Daniele Palossi [email protected] Vlad Niculescu [email protected] Lorenzo Lamberti [email protected] Copyright (C) 2021 ETH Zürich, University of Bologna. All rights reserved.

Videos

PULP Platform Youtube channel (subscribe it!)

Citing

If you use PULP-DroNet in an academic or industrial context, please cite the following publications:

Publications:

  • A 64mW DNN-based Visual Navigation Engine for Autonomous Nano-Drones arXiv preprint -- IEEE IoT Journal
  • An Open Source and Open Hardware Deep Learning-powered Visual Navigation Engine for Autonomous Nano-UAVs arXiv preprint -- IEEE DCOSS
  • Automated Tuning of End-to-end Neural FlightControllers for Autonomous Nano-drones IEEE AICAS
  • Improving Autonomous Nano-Drones Performance via Automated End-to-End Optimization and Deployment of DNNs -- IEEE JETCAS
  • Tiny-PULP-Dronets: Squeezing Neural Networks for Faster and Lighter Inference on Multi-Tasking Autonomous Nano-Drones -- IEEE AICAS
@article{palossi2019pulpdronetIoTJ, 
  author={D. {Palossi} and A. {Loquercio} and F. {Conti} and E. {Flamand} and D. {Scaramuzza} and L. {Benini}}, 
  title={A 64mW DNN-based Visual Navigation Engine for Autonomous Nano-Drones}, 
  journal={IEEE Internet of Things Journal}, 
  doi={10.1109/JIOT.2019.2917066}, 
  ISSN={2327-4662}, 
  year={2019}
}
@inproceedings{palossi2019pulpdronetDCOSS,
  author={D. {Palossi} and F. {Conti} and L. {Benini}},
  booktitle={2019 15th International Conference on Distributed Computing in Sensor Systems (DCOSS)},
  title={An Open Source and Open Hardware Deep Learning-Powered Visual Navigation Engine for Autonomous Nano-UAVs},
  pages={604-611},
  keywords={autonomous navigation, nano-size UAVs, deep learning, CNN, heterogeneous computing, parallel ultra-low power, bio-inspired},
  doi={10.1109/DCOSS.2019.00111},
  ISSN={2325-2944},
  month={May},
  year={2019},
}
@inproceedings{niculescu2021pulpdronetAICAS,
  author={V. {Niculescu} and L. {Lamberti} and D. {Palossi} and L. {Benini}},
  booktitle={2021 IEEE International Conference on Artificial Intelligence Circuits and Systems (AICAS)},
  title={Automated Tuning of End-to-end Neural FlightControllers for Autonomous Nano-drones},
  pages={},
  keywords={autonomous navigation, nano-size UAVs, deep learning, CNN, heterogeneous computing, parallel ultra-low power, bio-inspired},
  doi={},
  ISSN={},
  month={},
  year={2021},
}
@ARTICLE{pulpdronetv2JETCAS,
  author={Niculescu, Vlad and Lamberti, Lorenzo and Conti, Francesco and Benini, Luca and Palossi, Daniele},
  journal={IEEE Journal on Emerging and Selected Topics in Circuits and Systems}, 
  title={Improving Autonomous Nano-drones Performance via Automated End-to-End Optimization and Deployment of DNNs}, 
  year={2021},
  volume={},
  number={},
  pages={1-1},
  doi={10.1109/JETCAS.2021.3126259}}
@INPROCEEDINGS{lamberti_tinydronet,
  author={Lamberti, Lorenzo and Niculescu, Vlad and Barciś, Michał and Bellone, Lorenzo and Natalizio, Enrico and Benini, Luca and Palossi, Daniele},
  booktitle={2022 IEEE 4th International Conference on Artificial Intelligence Circuits and Systems (AICAS)}, 
  title={Tiny-PULP-Dronets: Squeezing Neural Networks for Faster and Lighter Inference on Multi-Tasking Autonomous Nano-Drones}, 
  year={2022},
  volume={},
  number={},
  pages={287-290},
  doi={10.1109/AICAS54282.2022.9869931}}

1. Introduction

What is PULP-Dronet ?

PULP-DroNet is a deep learning-powered visual navigation engine that enables autonomous navigation of a pocket-size quadrotor in a previously unseen environment. Thanks to PULP-DroNet the nano-drone can explore the environment, avoiding collisions also with dynamic obstacles, in complete autonomy -- no human operator, no ad-hoc external signals, and no remote laptop! This means that all the complex computations are done directly aboard the vehicle and very fast. The visual navigation engine is composed of both a software and a hardware part.

  • Software component: The software part is based on the previous DroNet project developed by the RPG from the University of Zürich (UZH). DroNet is a shallow convolutional neural network (CNN) which has been used to control a standard-size quadrotor in a set of environments via remote computation.

  • Hardware components: The hardware soul of PULP-DroNet is an ultra-low power visual navigation module embodied by a pluggable PCB (called shield or deck) for the Crazyflie 2.0/2.1 nano-drone. The shield features a Parallel Ultra-Low-Power (PULP) GAP8 System-on-Chip (SoC) from GreenWaves Technologies (GWT), an ultra-low power HiMax HBM01 camera, and off-chip Flash/DRAM memory; This pluggable PCB has evolved over time, from the PULP-Shield , the first custom-made prototype version developed at ETH Zürich, and its commercial off-the-shelf evolution, the AI-deck.

Evolution of PULP-Dronet

PULP-Dronet-V1:

The first version of PULP-Dronet, which gave the birth to the PULP-Shield: a lightweight, modular and configurable printed circuit board (PCB) with highly optimized layout and a form factor compatible with the Crazyflie nano-sized quad-rotor. We developed a general methodology for deploying state-of-the-art deep learning algorithms on top of ultra-low power embedded computation nodes, like a miniaturized drone, and then we automated the whole process. Our novel methodology allowed us first to deploy DroNet on the PULP-Shield, and then demonstrating how it enables the execution the CNN on board the CrazyFlie 2.0 within only 64-284mW and with a throughput of 6-18 frame-per-second! Finally, we field-prove our methodology presenting a closed-loop fully working demonstration of vision-driven autonomous navigation relying only on onboard resources, and within an ultra-low power budget. See the videos on the PULP Platform Youtube channel: video.

Summary of characteristics:

  • Hardware: PULP-Shield

  • Deep learning framework: Tensorflow/Keras

  • Quantization: fixed-point 16 bits, hand crafted

  • Deployment tool: AutoTiler (early release, developed in collaboration with GreenWaves Technologies)

We release here, as open source, all our code, hardware designs, datasets, and trained networks.

PULP-Dronet-V2:

This follow-up takes advantage of a new commercial-off-the-shelf PCB design based on the PULP-Shield, now developed and distributed by Bitcraze: the AI-deck. Our work focused in automating the whole deployment process of a convolutional neural network, which required significant complexity reduction and fine-grained hand-tuning to be successfully deployed aboard a flying nano-drone. Therefore, we introduce methodologies and software tools to streamline and automate all the deployment stages on a low-power commercial multicore SoC, investigating both academic (NEMO + DORY) and industrial (GAPflow by GreenWaves) tool-sets. We reduced by 2× the memory footprint of PULP-DronetV1, employing a fixed-point 8 bit quantization, achieving a speedup of 1.6× in the inference time, compared to the original hand-crafted CNN, with the same prediction accuracy. Our fully automated deployment methodology allowed us first to deploy DroNet on the AI-Deck, and then demonstrating how it enables the execution the CNN on board the CrazyFlie 2.1 within only 35-102mW and with a throughput of 9-17 frame-per-second!

Summary of characteristics:

  • Hardware: AI-deck

  • Deep learning framework: Pytorch

  • Quantization: fixed-point 8 bits, fully automated (with both academic NEMO and the industrial NNTool)

  • Deployment: fully automated (with both the academic DORY and the industrial AutoTiler)

We release here, as open source, all our code, hardware designs, datasets, and trained networks.

pulp-dronet's People

Contributors

dp8 avatar francescoconti avatar lorenzolamberti94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pulp-dronet's Issues

Output data that must be sent to the flight controller

What data is sent to the controller and what part of pulp-dronet v2 does this? Is there any example of a flight controller for the pulp-dronet?
Just one more question, in the installation which conda package should I install?

GAP_SDK4.22.0 cann`t be used!

Hi,
I changed gap_sdk version into 4.22.0. (why I must use gap_sdkv4.22.0,pls see heregap_sdk/issues/370)
But when I tried to runmake clean all run platform=gvsoc under path /pulp-dronet-v2/gapflow, I met this error:

(gap_sdk)
# chennaiting @ seu-netsi in ~/pulp-dronet/pulp-dronet-v2/gapflow on git:main x [20:05:39]
$ make clean all run platform=gvsoc
APP_SRCS... main.c BUILD_MODEL_SQ8BIT/networkKernels.c /home/chennaiting/pulp-dronet/gap_sdk/libs/gap_lib/img_io/ImgIO.c /home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_Activation_SQ8.c /home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_Bias_Linear_SQ8.c /home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_Conv_SQ8.c /home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_Pooling_SQ8.c /home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_Conv_DW_SQ8.c /home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_MatAlgebra_SQ8.c /home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_SoftMax_SQ8.c /home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_AT_Misc.c /home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/RNN_SQ8.c /home/chennaiting/pulp-dronet/gap_sdk/tools/nntool/autotiler/kernels/norm_transpose.c /home/chennaiting/pulp-dronet/gap_sdk/tools/nntool/autotiler/kernels/copy.c
APP_CFLAGS... -g -O3 -w -mno-memcpy -fno-tree-loop-distribute-patterns -I. -I/home/chennaiting/pulp-dronet/gap_sdk/libs/gap_lib/include -I/home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/Emulation -I/home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/Autotiler -I/home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries -I/home/chennaiting/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8 -I/home/chennaiting/pulp-dronet/gap_sdk/tools/nntool/autotiler/kernels -IBUILD_MODEL_SQ8BIT -DAT_MODEL_PREFIX=network -DAT_INPUT_HEIGHT=200 -DAT_INPUT_WIDTH=200 -DAT_INPUT_COLORS=1 -DSTACK_SIZE=6096 -DSLAVE_STACK_SIZE=1024 -DAT_IMAGE=/home/chennaiting/pulp-dronet/pulp-dronet-v2/gapflow/images/frame_2.pgm -DPERF -DMODEL_ID= -DFREQ_FC=250 -DFREQ_CL=175 -DAT_CONSTRUCT=networkCNN_Construct -DAT_DESTRUCT=networkCNN_Destruct -DAT_CNN=networkCNN -DAT_L3_ADDR=network_L3_Flash
sudo rm -f BUILD_MODEL_SQ8BIT/GenTile
sudo rm -f -rf BUILD_MODEL_SQ8BIT
sudo rm -f -rf nntool_output
**make: *** No rule to make target '/home/chennaiting/pulp-dronet/gap_sdk/tools/nntool/autotiler/generators/nntool_extra_generators.c', needed by 'BUILD_MODEL_SQ8BIT/GenTile'.  Stop.**

According to the error report, I deleted 55 lines of code in pulp-dronet-v2/gapflow/common/model_decl.mk

image
It do make some progresses, but still encountered error:

# chennaiting @ seu-netsi in ~/pulp/pulp-dronet/pulp-dronet-v2/gapflow on git:master x [19:08:43]
make clean all run platform=gvsoc
APP_SRCS... main.c BUILD_MODEL_SQ8BIT/networkKernels.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/libs/gap_lib/img_io/ImgIO.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_Activation_SQ8.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_Bias_Linear_SQ8.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_Conv_SQ8.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_Pooling_SQ8.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_Conv_DW_SQ8.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_MatAlgebra_SQ8.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_SoftMax_SQ8.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_AT_Misc.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/RNN_SQ8.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool//autotiler/kernels/norm_transpose.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool//autotiler/kernels/copy.c  
APP_CFLAGS... -g -O3 -w -mno-memcpy -fno-tree-loop-distribute-patterns -I. -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/libs/gap_lib/include -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/Emulation -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/Autotiler -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8 -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool//autotiler/kernels -IBUILD_MODEL_SQ8BIT -DAT_MODEL_PREFIX=network -DAT_INPUT_HEIGHT=200 -DAT_INPUT_WIDTH=200 -DAT_INPUT_COLORS=1 -DSTACK_SIZE=6096 -DSLAVE_STACK_SIZE=1024 -DAT_IMAGE=/home/chennaiting/pulp/pulp-dronet/pulp-dronet-v2/gapflow/images/frame_2.pgm -DPERF -DMODEL_ID= -DFREQ_FC=250 -DFREQ_CL=175 -DAT_CONSTRUCT=networkCNN_Construct -DAT_DESTRUCT=networkCNN_Destruct -DAT_CNN=networkCNN -DAT_L3_ADDR=network_L3_Flash
rm -f BUILD_MODEL_SQ8BIT/GenTile
rm -f -rf BUILD_MODEL_SQ8BIT
rm -f -rf nntool_output 
mkdir BUILD_MODEL_SQ8BIT
cp nntool_input/models_onnx/model_original.onnx BUILD_MODEL_SQ8BIT/network.onnx
echo "GENERATING NNTOOL STATE FILE"
GENERATING NNTOOL STATE FILE
echo BUILD_MODEL_SQ8BIT
BUILD_MODEL_SQ8BIT
nntool -s nntool_input/nntool_scripts/nntool_script_deployment BUILD_MODEL_SQ8BIT/network.onnx -q
settings - set log level to INFO
log_level - was: 'INFO'
now: 'INFO'
open - opening graph file BUILD_MODEL_SQ8BIT/network.onnx load_quantization = True
__init__ - unable to determine batch dimension. if the graph fails to import properly set it to 1 or a variable.
nngraph - update graph dimensions
nngraph - update graph dimensions
debug - was: False
now: True
adjust_order - adding transposes to correct tensor order for AT kernels
eliminate_transposes - no transposes to eliminate found
nngraph - update graph dimensions
nngraph - update graph dimensions
eliminate_transposes - no further transpose sequences found
nngraph - adjusted order
nngraph - update graph dimensions
move_node_up - Node _sig_Sigmoid cannot be moved
fuse_gap_convs - fusing nodes _layer1_Conv,_pool_MaxPool into _layer1_Conv_fusion
fuse_gap_convs - fusing nodes _resBlock1_conv1_Conv,_resBlock1_relu1_Clip into _resBlock1_conv1_Conv_fusion
fuse_gap_convs - fusing nodes _resBlock1_conv2_Conv,_resBlock1_relu2_Clip into _resBlock1_conv2_Conv_fusion
fuse_gap_convs - fusing nodes _resBlock1_bypass_Conv,_resBlock1_relu3_Clip into _resBlock1_bypass_Conv_fusion
fuse_gap_convs - fusing nodes _resBlock2_conv1_Conv,_resBlock2_relu1_Clip into _resBlock2_conv1_Conv_fusion
fuse_gap_convs - fusing nodes _resBlock2_conv2_Conv,_resBlock2_relu2_Clip into _resBlock2_conv2_Conv_fusion
fuse_gap_convs - fusing nodes _resBlock2_bypass_Conv,_resBlock2_relu3_Clip into _resBlock2_bypass_Conv_fusion
fuse_gap_convs - fusing nodes _resBlock3_conv1_Conv,_resBlock3_relu1_Clip into _resBlock3_conv1_Conv_fusion
fuse_gap_convs - fusing nodes _resBlock3_conv2_Conv,_resBlock3_relu2_Clip into _resBlock3_conv2_Conv_fusion
fuse_gap_convs - fusing nodes _resBlock3_bypass_Conv,_resBlock3_relu3_Clip into _resBlock3_bypass_Conv_fusion
matcher - ++ fusion fuse_gap_convs modified graph
slice_to_split - replaced slice nodes _Gather,_Gather_1 with split node _Gather_split
matcher - ++ fusion slice_to_split modified graph
insert_copies - inserting copy between _Gather_reshape0:0 and output_1:0
matcher - ++ fusion insert_copies modified graph
remove_reshapes_before_linear - removing unnecessary reshape before linear _Flatten
matcher - ++ fusion remove_reshapes_before_linear modified graph
fuse_op_activation - fusing nodes _resBlock3_Add,_relu_Clip
matcher - ++ fusion fuse_op_activation_scale8 modified graph
move_node_up - Node _sig_Sigmoid cannot be moved
matcher - ++ fusion scaled_match_group modified graph
move_node_up - Node _sig_Sigmoid cannot be moved
adjust_order - adding transposes to correct tensor order for AT kernels
eliminate_transposes - no transposes to eliminate found
nngraph - update graph dimensions
nngraph - update graph dimensions
eliminate_transposes - no further transpose sequences found
nngraph - adjusted order
input_norm_func - was: ''
now: 'x:x/255'
Traceback (most recent call last):
  File "/home/chennaiting/anaconda3/envs/gap_sdk_4.22/lib/python3.8/site-packages/cmd2/cmd2.py", line 1661, in onecmd_plus_hooks
    stop = self.onecmd(statement, add_to_history=add_to_history)
  File "/home/chennaiting/anaconda3/envs/gap_sdk_4.22/lib/python3.8/site-packages/cmd2/cmd2.py", line 2081, in onecmd
    stop = func(statement)
  File "/home/chennaiting/anaconda3/envs/gap_sdk_4.22/lib/python3.8/site-packages/cmd2/decorators.py", line 223, in cmd_wrapper
    return func(cmd2_app, args)
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/nntool/interpreter/commands/aquant.py", line 99, in do_aquant
    data = [import_data(input_file, **input_args)
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/nntool/interpreter/commands/aquant.py", line 99, in <listcomp>
    data = [import_data(input_file, **input_args)
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/nntool/utils/data_importer.py", line 171, in import_data
    return import_image_data(filename, **kwargs)
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/nntool/utils/data_importer.py", line 134, in import_image_data
    return postprocess(img_in, height, width, channels, **kwargs)
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/nntool/utils/data_importer.py", line 86, in postprocess
    img_in = np.array(img_in, dtype=np.float)
  File "/home/chennaiting/anaconda3/envs/gap_sdk_4.22/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
EXCEPTION of type 'AttributeError' occurred with message: 'module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations'
Traceback (most recent call last):
  File "/home/chennaiting/anaconda3/envs/gap_sdk_4.22/lib/python3.8/site-packages/cmd2/cmd2.py", line 1661, in onecmd_plus_hooks
    stop = self.onecmd(statement, add_to_history=add_to_history)
  File "/home/chennaiting/anaconda3/envs/gap_sdk_4.22/lib/python3.8/site-packages/cmd2/cmd2.py", line 2081, in onecmd
    stop = func(statement)
  File "/home/chennaiting/anaconda3/envs/gap_sdk_4.22/lib/python3.8/site-packages/cmd2/decorators.py", line 223, in cmd_wrapper
    return func(cmd2_app, args)
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/nntool/interpreter/commands/qshow.py", line 41, in do_qshow
    self._check_quantized()
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/nntool/interpreter/nntool_shell_base.py", line 271, in _check_quantized
    raise GraphNotReadyException(CHECK_QUANTIZED_ERROR)
nntool.interpreter.nntool_shell_base.GraphNotReadyException: 
The opened graph must be quantized to use this command. Run the aquant command.

EXCEPTION of type 'GraphNotReadyException' occurred with message: '
The opened graph must be quantized to use this command. Run the aquant command.
'
nngraph - update graph dimensions
inserted image formatter after node input_1 withformat bw8 and normalization shift_int8
l3_ram_ext_managed - was: False
now: True
default_input_exec_location - was: 'AT_MEM_L2'
now: 'AT_MEM_L3_HRAM'
graph_produce_node_names - was: False
now: True
graph_reorder_constant_in - was: True
now: True
graph_produce_operinfos - was: False
now: True
graph_monitor_cycles - was: False
now: True
Traceback (most recent call last):
  File "/home/chennaiting/anaconda3/envs/gap_sdk_4.22/lib/python3.8/site-packages/cmd2/cmd2.py", line 1661, in onecmd_plus_hooks
    stop = self.onecmd(statement, add_to_history=add_to_history)
  File "/home/chennaiting/anaconda3/envs/gap_sdk_4.22/lib/python3.8/site-packages/cmd2/cmd2.py", line 2081, in onecmd
    stop = func(statement)
  File "/home/chennaiting/anaconda3/envs/gap_sdk_4.22/lib/python3.8/site-packages/cmd2/decorators.py", line 223, in cmd_wrapper
    return func(cmd2_app, args)
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/nntool/interpreter/commands/save_state.py", line 49, in do_save_state
    self._check_quantized()
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/nntool/interpreter/nntool_shell_base.py", line 271, in _check_quantized
    raise GraphNotReadyException(CHECK_QUANTIZED_ERROR)
nntool.interpreter.nntool_shell_base.GraphNotReadyException: 
The opened graph must be quantized to use this command. Run the aquant command.

EXCEPTION of type 'GraphNotReadyException' occurred with message: '
The opened graph must be quantized to use this command. Run the aquant command.
'
echo "GENERATING AUTOTILER MODEL"
GENERATING AUTOTILER MODEL
nntool -g -M nntool_output -m networkModel.c -T nntool_output/tensors BUILD_MODEL_SQ8BIT/network.json
Traceback (most recent call last):
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/scripts/nntool", line 107, in <module>
    main()
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/scripts/nntool", line 89, in main
    mod.generate_code(args)
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/nntool/interpreter/generator.py", line 72, in generate_code
    nntool_shell.load_state_file(args.graph_file)
  File "/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool/nntool/interpreter/nntool_shell_base.py", line 374, in load_state_file
    with open(filepath) as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'BUILD_MODEL_SQ8BIT/network.json'
make: *** [common/model_rules.mk:49: nntool_output/networkModel.c] Error 1

According to debug, error reporting seems to be generated in the process of quantification:
image
It seems that the error is caused by the numpy version. My numpy==1.24.2.
So I changed my numpy into numpy==1.23.0, and it works! But still met error:

echo "COMPILING AUTOTILER MODEL"
COMPILING AUTOTILER MODEL
gcc -g -o BUILD_MODEL_SQ8BIT/GenTile -I. -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/Autotiler -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/Emulation -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Generators -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Generators_SQ8 -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool//autotiler/generators -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8 -I/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/nntool//autotiler/kernels /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Generators/CNN_Generator_Util.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Generators_SQ8/CNN_Generators_SQ8.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Generators_SQ8/RNN_Generators_SQ8.c nntool_output/networkModel.c /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/Autotiler/LibTile.a  
In file included from /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/CNN_BasicKernels_SQ8.h:21,
                 from /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Generators_SQ8/RNN_Generators_SQ8.h:21,
                 from /home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Generators_SQ8/RNN_Generators_SQ8.c:21:
/home/chennaiting/pulp/pulp-dronet/gap_sdk/tools/autotiler_v3/CNN_Libraries_SQ8/../CNN_Libraries/CNN_Copy.h:23:10: fatal error: CNN_FloatType.h: No such file or directory
   23 | #include "CNN_FloatType.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [common/model_rules.mk:56: BUILD_MODEL_SQ8BIT/GenTile] Error 1

I think this problem is caused by the large span of changing gap_sdkv3.9 to gap_sdkv4.22 (some file location may already changed). I wonder if there are any solutions? Or I can just modify the pulp-dronet's makefile by my own?

How to use your best weights

@DP8 Hi,
I'm reading your work, "DroNet Learning to Fly by Driving" and "An Open Source and Open Hardware Deep Learning-powered Visual Navigation Engine". I was inspired that you use DroNet to fly nano UAV in the lab environments. But I still meet some questions.
I was using the following code to predict a single image. The model and the best weights I used was from https://github.com/uzh-rpg/rpg_public_dronet. In addition, I tested the single image from your Himax_Dataset-master/test_2/frame_26.pgm.
It's really good to test the outdoor images, but hard to get the correct results for indoor sceneries.
I was using the keras to construct the model, so I can't use your hex weights from your pulp-dronet/weights/binary/.
So may I know how you trained your DroNet for the pulp-dronet.
Did you use keras or any other dependencies and packages?
Or if you can provide the best weights of pulp-dronet which you originally generated .hex files like h5py or so forth?

from PIL import Image
import utils
import numpy as np
import cv2


model = utils.jsonToModel("model/model_struct.json")
model.load_weights("model/best_weights.h5")
model.summary()


def central_image_crop(img, crop_width=150, crop_heigth=150):

    half_the_width = int(img.shape[1] / 2)
    img = img[img.shape[0] - crop_heigth: img.shape[0],
          half_the_width - int(crop_width / 2):
          half_the_width + int(crop_width / 2)]
    return img


def read_img():
    img = np.array(Image.open("./model/Himax_Dataset-master/test_2/frame_26.pgm"))  
    cv2.imshow('', img)
    cv2.waitKey(0)
    img_central = central_image_crop(img, 200, 200) 
    img_01 = np.asarray(img_central, dtype=np.float32) * np.float32(1.0/255.0) 
    img_3d = np.expand_dims(img_01, axis=0)  
    im_4d = img_3d[:, :, :, np.newaxis]    
    return im_4d



im = read_img()    
outs = model.predict([im])
steer, coll = outs[0][0], outs[1][0]
print("Steer angle= ", steer)
print("Collision prob= ", coll)

Why no chceckpoint issue is arising

working directory: /home/research/Documents/Pytorch/Nano_Drone/pulp-dronet-master/pulp-dronet-v2

Model name: model/dronet_v2_nemo_dory_original_himax.pth
CUDA/CPU device: cuda:0
pyTorch version: 1.6.0
You are testing on the himax dataset

loaded checkpoint on cuda
Failed to find the [state_dict] inside the checkpoint. I will try to open it anyways.
model tested: model/dronet_v2_nemo_dory_original_himax.pth evaluated on the: himax dataset
Test: 0%| | 0/7 [00:00<?, ?it/s]
Traceback (most recent call last):
File "testing.py", line 174, in
main()
File "testing.py", line 170, in main
testing(net, test_loader, device)
File "testing.py", line 86, in testing
outputs = model(inputs)
File "/home/research/anaconda3/envs/pulp-dronet-v2/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/research/Documents/Pytorch/Nano_Drone/pulp-dronet-master/pulp-dronet-v2/model/dronet_v2_nemo_dory.py", line 90, in forward
x = self.fc(x)
File "/home/research/anaconda3/envs/pulp-dronet-v2/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/research/anaconda3/envs/pulp-dronet-v2/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 91, in forward
return F.linear(input, self.weight, self.bias)
File "/home/research/anaconda3/envs/pulp-dronet-v2/lib/python3.8/site-packages/torch/nn/functional.py", line 1676, in linear
output = input.matmul(weight.t())
RuntimeError: mat1 dim 1 must match mat2 dim 0

How can I get the get the output of dronet by UART

Hi,
I follow the guidance in [https://github.com/pulp-platform/pulp-dronet/tree/master/pulp-dronet-v2] and run the DroNet on ai deck successfully。

..........
Checksum in/out Layer : Ok
Layer MatMul 14 ended:
Checksum final : Ok

[0] : num_cycles: 7892720
[0] : MACs: 43238144
[0] : MAC/cycle: 26815622261777050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000
[0] : n. of Cores: 8

Is it meant that the dronet work on ai deck continuously ? How can I get the get the output of dronet by UART? And I can‘t find any code about UART in the folder /application (which is the deployment C code).
Sorry if I didn't make myself clear.

Segmentation fault (Core dumped)

Hi @LorenzoLamberti94,
This is really nice works. I wanna reproduce your works and see the performances but there is an error like following:

(pulp-dronet-v1) hugh@hugh-ThinkPad-S1-Yoga:~/pulp-dronet/pulp-dronet-v1/src$ make conf run
plpflags gen --input=gap@config_file=chips/gap/gap.json  --config=platform=gvsoc  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_1.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_2.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_3.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_4.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_5.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_6.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_7.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_8.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_9.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_10.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_dense_1.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_dense_2.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_1.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_2.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_3.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_4.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_5.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_6.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_7.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_8.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_9.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_10.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_dense_1.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_dense_2.hex  --config=camera/image-stream=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../dataset/Himax_Dataset/test_2/frame_22.pgm  --config=**/rt/type=pulp-rt --output-dir=/home/hugh/pulp-dronet/pulp-dronet-v1/src/build/gap --makefile=/home/hugh/pulp-dronet/pulp-dronet-v1/src/build/gap/config.mk    --app=PULPDroNet --config-user=/home/hugh/pulp-dronet/pulp-dronet-v1/src/config.ini
plpconf --input=gap@config_file=chips/gap/gap.json  --config=platform=gvsoc  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_1.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_2.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_3.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_4.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_5.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_6.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_7.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_8.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_9.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_10.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_dense_1.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_dense_2.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_1.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_2.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_3.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_4.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_5.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_6.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_7.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_8.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_9.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_10.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_dense_1.hex  --config=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_dense_2.hex  --config=camera/image-stream=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../dataset/Himax_Dataset/test_2/frame_22.pgm  --config=**/rt/type=pulp-rt --output=/home/hugh/pulp-dronet/pulp-dronet-v1/src/build/gap/config.json --config-user=/home/hugh/pulp-dronet/pulp-dronet-v1/src/config.ini
pulp-run --config-file=gap@config_file=chips/gap/gap.json  --config-opt=platform=gvsoc  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_1.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_2.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_3.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_4.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_5.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_6.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_7.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_8.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_9.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_10.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_dense_1.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_dense_2.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_1.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_2.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_3.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_4.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_5.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_6.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_7.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_8.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_9.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_10.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_dense_1.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_dense_2.hex  --config-opt=camera/image-stream=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../dataset/Himax_Dataset/test_2/frame_22.pgm  --config-opt=**/rt/type=pulp-rt --config-user=/home/hugh/pulp-dronet/pulp-dronet-v1/src/config.ini  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_1.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_2.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_3.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_4.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_5.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_6.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_7.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_8.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_9.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_conv2d_10.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_dense_1.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/weights_dense_2.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_1.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_2.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_3.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_4.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_5.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_6.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_7.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_8.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_9.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_conv2d_10.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_dense_1.hex  --config-opt=flash/fs/files=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../weights/binary/bias_dense_2.hex  --config-opt=camera/image-stream=/home/hugh/pulp-dronet/pulp-dronet-v1/src/../dataset/Himax_Dataset/test_2/frame_22.pgm  --config-opt=**/rt/type=pulp-rt --dir=/home/hugh/pulp-dronet/pulp-dronet-v1/src/build/gap --binary=PULPDroNet/PULPDroNet
Segmentation fault (core dumped)
/home/hugh/pulp-dronet/pulp-dronet-v1/src/build/gap/__rules.mk:180: recipe for target 'run' failed
make: *** [run] Error 139

It will be really appreciate if you can help with this question.
Hugh

Trained model of pulp-dronet V2

Hello, I'm recently studying on your work and I'm trying to flash this work on AI-deck. I'm wondering if you have a trained model available for pulp-dronet V2 on AI-deck. Thanks for your reply.

make clean all Error under /pulp-dronet/pulp-dronet-v2/gapflow

Hi,
I try make clean all under /pulp-dronet/pulp-dronet-v2/gapflow . But met the following errors: https://pastebin.pl/view/9e1a8baf.

# part of Error log
Error: Graph stacked tensor S16_Output, input tensor Output_1 is also defined as a graph local or graph argument
Execution aborted

I don't konw how to solve it.
Hoping I can get solutions here.

My code environment:
gap_sdk = 3.8, python =3.7, ubuntu18.04.
Using the onnx export by /pulp-dronet/pulp-dronet-v2/model/dronet_v2_gapflow_original_himax.pth and /pulp-dronet/pulp-dronet-v2/model/dronet_v2_gapflow_original.pth
I tried gap_sdk = 3.9 but got more Errors: https://pastebin.pl/view/8518979a

Regards,
Mathilda

Compatibility with Crazyflie 2.1?

Is this project / software / PULP-Shield compatible with the new version of Crazyflie? The old version (2.0) has been marked as Discontinued.

About updated gap_SDK.

Hi,
Greenwave has recently updated the version of gap_sdk. I would like to ask if the newer version of gap_sdk is applicable to pulp-dronet-v2? Will there be any impact if I update the version of the gap_sdk of Dronet?

The drone doesnt fly

hi
I have been trying to replicate this project with Crazyflies 2.0 and ai-deck. I have followed the instruction and managed to deploy the code into the drone but when I restart the drone nothing happens, any idea why?

Screenshot_from_2022-03-22_20-33-40

Evaluation for EVA, RMSE, Acc, F1

Hello @LorenzoLamberti94,
I recently reviewed your pulp-dronet-v1 which is really interesting. However, I have some questions about how did you eveluate your results (i.e., EVA, RMSE, Acc, F1)?
I ran the code based on https://github.com/pulp-platform/pulp-dronet, and saw the results as 16-bit fixed point as:

Result[steer][coll]:	134	-23937
Result[steer][coll]:	147	-25122

But the EVA, RMSE, Acc and F1 requires float point to calculate.
I'll be really appreciate if you can help with my question.
Yingxiu Chang

Not able to flash pulp-dronet for the ai-deck

Dear @DP8 and @FrancescoConti ,

At the moment I am working with the ai-deck from BitCraze and I am trying to flash the pulp-dronet on it. For this I also started working from the gap_sdk which incorporates the necesarry pulp-sdk elements. There I encountered a bug with bridge and runtime #MNIST example error: Protocol version mismatch between bridge and runtime GreenWaves-Technologies/gap_sdk#101. I was wondering if this is also the case for the pulp-dronet as I got stuck at starting execution.

This error in part can also be caused by not having the correct configuration settings for the ai-deckv1 and ai-deckv2 as I got the same error message when working with the gap_sdk and the ai-deck with gap8_v1, when I found the correct settings. I managed to run the helloworld example on both ai-decks. So if this is the case, than could you point me in the right directions where to find the possible settings? I have looked and till now I was not able to combine the information from the platform and gap settings to make an ai-deck_v1 or ai-deck_v2 compatible setting. Thanks in advance.

user@bitcrazeDemo:~/pulp-dronet/weights$ plpbridge --cable=ftdi --chip=gap flash_erase_chip flash_write --addr=0 --file=./WeightsPULPDroNet.raw
Notifying to boot code that we are doing a JTAG boot
Found ftdi device i:0x15BA:0x2A:0
Connecting to ftdi device i:0x15BA:0x2A:0
Loading binary through jtag
Notifying to boot code that we are doing a JTAG boot
Loading binaries
Loading /home/user/pulp-sdk/pkg/sdk/dev/install/bin/flasher-gap
Loading section (base: 0x1b000004, size: 0x3ec)
Loading section (base: 0x1b0003f0, size: 0x840)
Loading section (base: 0x1c000000, size: 0x62dc)
Init section to 0 (base: 0x1c0062dc, size: 0x1b0)
Loading section (base: 0x1c00648c, size: 0x10)
Starting execution
^CTerminated

Can it fly without ever using the Crazyradio?

Hi,

I was reading your paper "A 64mW DNN-based Visual Navigation Engine for Autonomous Nano-Drones" + the readme file from this repo and I got the idea the system presented is fully autonomous.

So, I'm interested in the possibility of using a Crazyflie without ever connecting to it to my PC with the Crazyradio and I would like to know if in the experiments presented by your paper you had to use the Crazyradio or not (there's no mention to it).

Thanks!

How to develop the nemo-dory flow code on AI-deck?

Hi,
After droy-C code, how can I develop this code on AI-deck?
In PULP-DRONET-V2/gapflow/main.c, there is a main.c that controls the whole process (Himax camera, uart, etc.).
But the generated dory-c code does not have this kind of AI-deck control code ,like /gapflow/main.c.
Do I need to write the nemo-dory flow control code (Himax camera, uart, etc.) by myself? Or I can use /gapflow/main.c to implement the control of AI-deck in nemo-dory flow?
Regards,
Mathilda

Lost part Himax dataset?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.