Search found 12 matches

by gjhave
Tue Aug 29, 2023 9:27 am
Forum: ESP-WHO 中文讨论版
Topic: ValueError: current model is not supported by esp-dl
Replies: 5
Views: 57632

Re: ValueError: current model is not supported by esp-dl

可以直接复制相邻像素来做上采样,具体可以看 torch.nn.Upsample: https://pytorch.org/docs/stable/generated/torch.nn.Upsample.html 您好!感谢回复! 我也尝试过padding,transposeconv2d,nn.upsample等其他方法来进行上采样,训练是没有问题的,但会带来其他几个问题: 1、不同的上采样方法,在转ONNX并进行量化的过程中,由于图优化的过程可能会产生一些胶水层,会增加运算量 2、具体部署过程的工具由ESP官方提供,这些上采样的方法或者算子,dl_layer中并没有提供,图优化过程中产生的胶...
by gjhave
Tue Aug 29, 2023 3:34 am
Forum: ESP-WHO 中文讨论版
Topic: pytorch中depthwidth_conv2d在esp32s3上的优化问题
Replies: 0
Views: 26051

pytorch中depthwidth_conv2d在esp32s3上的优化问题

各位好,我用pytorch1.13写的模型,因为pytorch中没有直接的depthwidth_conv2d的算子,所以我做了如下替代: 就是把groups设置成input_channels class DepthWidth_Conv2d(nn.Module): def __init__(self, input_channels, output_channels, kernel_size=1, strides=1, padding=1) -> None: super(Conv, self).__init__() self.models = nn.Sequential() self.models...
by gjhave
Tue Aug 29, 2023 3:17 am
Forum: ESP-WHO 中文讨论版
Topic: 【已解决】使用TVM量化部署模型报错NameError: name 'GenerateESPConstants' is not defined
Replies: 4
Views: 31368

Re: 使用TVM量化部署模型报错NameError: name 'GenerateESPConstants' is not defined

TFST123 wrote:
Sun Aug 27, 2023 7:31 am
看到github上已经解决了,想问一下具体是怎么解决的?我也出现了相同的错误。是换了换成python=3.7就可以了吗,但是我的python就是3.7的
反正是环境的问题,我之前在windows上部的环境,折腾很久,后来用linux安装官方的教程就搞定了。具体是什么原因造成的,我也说不清楚,但是这个问题没有了,又碰到其他问题。
by gjhave
Mon Aug 21, 2023 9:12 am
Forum: ESP-WHO 中文讨论版
Topic: ValueError: current model is not supported by esp-dl
Replies: 5
Views: 57632

Re: ValueError: current model is not supported by esp-dl

ESP_Sandra wrote:
Mon Aug 21, 2023 9:04 am
Hi
convtranspose2d 没有支持哦
请问在sdk中,有什么可以替代的吗?主要是上采样
by gjhave
Mon Aug 21, 2023 8:42 am
Forum: ESP-WHO 中文讨论版
Topic: ValueError: current model is not supported by esp-dl
Replies: 5
Views: 57632

ValueError: current model is not supported by esp-dl

使用esp-dl中的example量化我的YOLO模型时,提示:ValueError: current model is not supported by esp-dl 错误,
请看我的代码和模型结构,我的模型中,只用了con2d, batchnormal, leakyrelu,convtranspos2d,add,concat
这些算子esp-dl中的量化算子规范都是支持的,不知道为什么还会提示不支持。
我使用的是esp-dl-release-1.1分支,esp-idf-v4.4分支
model.png
模型结构
model.png (655.58 KiB) Viewed 57632 times
1.png
代码和报错提示
1.png (63.64 KiB) Viewed 57632 times
by gjhave
Mon Aug 21, 2023 2:54 am
Forum: ESP-WHO 中文讨论版
Topic: 【已解决】按照教程量化过程中,from calibrator import *问题
Replies: 2
Views: 28135

Re: 按照教程量化过程中,from calibrator import *问题

ESP_Junru wrote:
Mon Aug 21, 2023 2:49 am
请再 esp_dl 中将这个 python 包放到你的脚本目录下
感谢回复,是的,这个包就在我的脚本目录下,只是我的python是3.11,我换了3.7就可以正常导入了,但是在python3.7下,torch只支持1.13版本,而我的模型时2.0版本训练的。这就导致又提示当前环境不支持我的模型。真是悲剧。官方啥时候能支持到python3.10以上,torch2.0以上啊。torch2.0可好用太多了
by gjhave
Mon Aug 21, 2023 2:50 am
Forum: ESP-WHO 中文讨论版
Topic: 【已解决】使用TVM量化部署模型报错NameError: name 'GenerateESPConstants' is not defined
Replies: 4
Views: 31368

Re: 使用TVM量化部署模型报错NameError: name 'GenerateESPConstants' is not defined

我重新下载的ESP-DL的release-1.1分支,发现里面是没有TVM工具的,之前抱这个错误是使用的master分支,所以这个错误有可能是master分支还没有做完。
在release分支下,环境只支持python3.7, torch1.13,但是我的模型时torch2.0训练的,量化过程中右报错当前环境不支持我的模型。真是悲剧啊。官方啥时候能支持到python 3.10以上,torch2.0啊。
by gjhave
Sun Aug 20, 2023 4:02 am
Forum: ESP-WHO 中文讨论版
Topic: 【已解决】使用TVM量化部署模型报错NameError: name 'GenerateESPConstants' is not defined
Replies: 4
Views: 31368

【已解决】使用TVM量化部署模型报错NameError: name 'GenerateESPConstants' is not defined

各位好,我在使用TVM部署模型时,遇到一下错误,请问如何解决?我进esp.py文件看,有如下两个函数是找不到定义的:
GenerateESPConstants(),
ExtractConstantsFromPartitionedFunction(),
屏幕截图 2023-08-20 115819.png
屏幕截图 2023-08-20 115819.png (26.01 KiB) Viewed 31368 times
by gjhave
Thu Aug 17, 2023 7:18 am
Forum: ESP-IDF 中文讨论版
Topic: 【已解决】引用项目文件夹以外的外部组件错误
Replies: 2
Views: 1421

Re: 引用项目文件夹以外的外部组件错误

使用 REQUIRES 会默认从 IDF 目录下的 components 文件夹和项目中的 components 文件夹(如有)寻找组件,如果组件在别的位置,则需要使用 EXTRA_COMPONENT_DIRS。 参考如下: set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/bluetooth/esp_ble_mesh/common_components/button) 参考文档: https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/api-guides/build-sy...
by gjhave
Thu Aug 17, 2023 4:00 am
Forum: ESP-WHO 中文讨论版
Topic: 【已解决】按照教程量化过程中,from calibrator import *问题
Replies: 2
Views: 28135

【已解决】按照教程量化过程中,from calibrator import *问题

我根据教程尝试量化自己的模型过程中,导入esp-dl中提供的工具,出现了如下问题:

问题1:from optimizer import *
导入optimizer的过程,会调到optimizer文件中,报错如下:
截图.png
截图.png (37.91 KiB) Viewed 28135 times
问题2:from calibrator import * 和 from evaluator import *
导入calibrator和evaluator这两个库是,报错如下:
截图3.png
截图3.png (32.17 KiB) Viewed 28135 times
我的onnx,keras等已经正常安装:版本截图如下:
截图2.png
截图2.png (18.92 KiB) Viewed 28135 times
请问如何解决?谢谢