切换版块
×
基础软件平台
PyTorch开发
TensorFlow开发
编解码及SDK开发
BANG语言与计算库
开发工具链
MagicMind开发
软件栈百科
云平台集成
硬件产品专区
MLU370系列AI加速卡
MLU270系列AI加速卡
MLU220系列AI加速产品
经验方案交流区
经验案例与实践分享
开发者服务
开发者活动
公告与版务
高校支持
《智能计算系统》
签到
版块
社区
文档
SDK下载
370系列
200系列
开发平台
官网首页
注册
登录
全部版块
基础软件平台
硬件产品专区
经验方案交流区
开发者服务
高校支持
发布新帖
登录/注册
LV.1
誓约
208
积分
1
赞
24
帖子
117
回复
1
收藏
TA的动态
TA的帖子
TA的回复
加急:如何调试寒武纪pytorch程序
我的回复:import torch from torch.backends import cudnn from backbone import EfficientDetBackbone import cv2 import matplotlib #matplotlib.use('tkAgg') import matplotlib.pyplot as plt import numpy as np from efficientdet.utils import BBoxTransform, ClipBoxes from utils.utils import preprocess, invert_affine, postprocess import torch_mlu import torch_mlu.core.mlu_model as ct import torch_mlu.core.mlu_quantize as mlu_quantize import torchvision.models as models ct.set_core_number(1) ct.set_core_version("MLU270") torch.set_grad_enabled(False) compound_coef = 0 force_input_size = None # set None to use default size img_path = 'datasets/birdview_vehicles/val/1135.jpg' threshold = 0.2 iou_threshold = 0.2 use_cuda = False use_float16 = False #cudnn.fastest = True #cudnn.benchmark = True obj_list = [ 'large-vehicle', 'small-vehicle' ] # tf bilinear interpolation is different from any other's, just make do input_sizes = [512, 640, 768, 896, 1024, 1280, 1280, 1536] input_size = input_sizes[compound_coef] if force_input_size is None else force_input_size ori_imgs, framed_imgs, framed_metas = preprocess(img_path, max_size=input_size) x = torch.stack([torch.from_numpy(fi) for fi in framed_imgs], 0) print(x) x = x.permute(3, 1, 2, 0) x = x.to(ct.mlu_device()) #print(x) x = x[:, 1:, 2:-1:3, 5:10] #x = x[1,0:100,2] print("打印x:") print(x.cpu())比如这个例子,我在vscode+mlu270上跑x = x[:, 1:, 2:-1:3, 5:10],程序会出现cnml错误,但是能运行成功我如果跑x = x[1,0:100,2],就不报slice的错误,是不是在mlu上调用算子的方法和在cuda上用算子的方法不一致
0
加急:如何调试寒武纪pytorch程序
我的回复:#1andy_marvelous回复您好,请问您目前是用 逐层模式 还是 融合模式 运行程序呢?同时,辛苦您提供测试代码以及测试环境。展开import torch from torch.backends import cudnn from backbone import EfficientDetBackbone import cv2 import matplotlib #matplotlib.use(\'tkAgg\') import matplotlib.pyplot as plt import numpy as np from efficientdet.utils import BBoxTransform, ClipBoxes from utils.utils import preprocess, invert_affine, postprocess import torch_mlu import torch_mlu.core.mlu_model as ct import torch_mlu.core.mlu_quantize as mlu_quantize import torchvision.models as models ct.set_core_number(1) ct.set_core_version(\"MLU270\") torch.set_grad_enabled(False) compound_coef = 0 force_input_size = None # set None to use default size img_path = \'datasets/birdview_vehicles/val/1135.jpg\' threshold = 0.2 iou_threshold = 0.2 use_cuda = False use_float16 = False #cudnn.fastest = True #cudnn.benchmark = True obj_list = [ \'large-vehicle\', \'small-vehicle\' ] # tf bilinear interpolation is different from any other\'s, just make do input_sizes = [512, 640, 768, 896, 1024, 1280, 1280, 1536] input_size = input_sizes[compound_coef] if force_input_size is None else force_input_size ori_imgs, framed_imgs, framed_metas = preprocess(img_path, max_size=input_size) x = torch.stack([torch.from_numpy(fi) for fi in framed_imgs], 0) print(x) x = x.permute(3, 1, 2, 0) x = x.to(ct.mlu_device()) #print(x) x = x[:, 1:, 2:-1:3, 5:10] #x = x[1,0:100,2] print(\"打印x:\") print(x.cpu())
0
CNML error: CNML_STATUS_INVALIDPARAM 和 Op cannot run on MLU device
我的回复:#1onlinedj回复参考:https://www.cambricon.com/docs/pytorch/pytorch_8_customized_operation/index.html展开您好,请问您调试寒武纪pytorch程序一般怎么调试的,特别是在vscode上
0
在270上推理Efficiendet量化后的模型报错
我的回复:#1jiapeiyuan回复1)self.padding得是一个tuple,你传了一个int2)slice op应该是另外一个问题,先定位到是哪个slice操作导致的,再看看写法为什么mlu不支持,考虑换其他写法展开您好,请问怎么在VScode上调试寒武纪pytorch程序,这个slice错误是我单步调试的出的错,也同时报出了很多算子错误比如cat,eq,ne,mask_select等 Op cannot run on MLU device, start running on CPU!不调试不报任何错误。 越来越感觉是我调试方法不对,跑一个简单的加法运算运行没错,但是在vscode单步调试也报很多算子无法加载到mlu上的错误。我的VScode的调试配置文件是默认的没有任何更改,是不是我的调试方式不对呢?
0
如何实现Yolov5Detection算子并集成到CNPlugin
我的回复:#1andy_marvelous回复您好,sdk 1.7.0内的pytorch已包含Yolov5Detection后处理算子,无需再手动集成。请问另一个教程在哪呢
0
在270上推理量化后的模型报错
我的回复:已解决
0
在270上推理Efficiendet量化后的模型报错
我的回复:#1jiapeiyuan回复1)self.padding得是一个tuple,你传了一个int2)slice op应该是另外一个问题,先定位到是哪个slice操作导致的,再看看写法为什么mlu不支持,考虑换其他写法展开感谢感谢,之前误写了一个=0,谢谢大佬
0
pytorch移植问题
我的回复:您好,我的firstconv设置的是false,还是出了这个同样的错误,请问该怎么解决呢
0
无法被量化的卷积层或者某个层如何被量化,或者如何跳过?
我的回复:#3jiapeiyuan回复这样定义的conv是可以量化的,不算自定义好的,谢谢您的解答,量化成功了,
0
无法被量化的卷积层或者某个层如何被量化,或者如何跳过?
我的回复:#1jiapeiyuan回复卷积/全连接 层一定可以被量化,而且必须量化。其他层都不能量化您好,请问像这样的层能被量化吗?算是自定义的层吗? class Conv2dStaticSamePadding(nn.Module): \"\"\" created by Zylo117 The real keras/tensorflow conv2d with same padding \"\"\" def __init__(self, in_channels, out_channels, kernel_size, stride=1, bias=True, groups=1, dilation=1, **kwargs): super().__init__() self.conv = nn.Conv2d(in_channels, out_channels, kernel_size, stride=stride, bias=bias, groups=groups) self.stride = self.conv.stride self.kernel_size = self.conv.kernel_size self.dilation = self.conv.dilation 类Conv2dStaticSamePadding的self.conv属性值是nn.Conv2d,而Conv2d是继承的_ConvNd,代码如下: class Conv2d(_ConvNd):
0
上一页
1
2
3
4
5
6
7
下一页
Github
开发平台
文档中心
新手必读
官方微信
版权所有 © 2024 寒武纪 Cambricon.com 备案/许可证号:
京ICP备17003415号-1
关闭