The error is caused by the fact that the ResNet class constructor requires two arguments block and layers, which are not provided when creating an instance of the class. To fix the error, you need to provide these arguments when creating an instance of the ResNet class. For example:

network = ResNet(BasicBlock, [2, 2, 2, 2])

This creates an instance of the ResNet class with BasicBlock as the block type and [2, 2, 2, 2] as the number of layers for each block in the ResNet. Adjust the values of these arguments based on your specific needs.

import numpy as npimport mindsporedataset as dsimport osimport cv2import mindsporeimport mindsporenn as nnfrom mindspore import Tensorfrom mindsporecommoninitializer import Normalfrom mindspore import

原文地址: https://www.cveoy.top/t/topic/bnGW 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录