I wrote a small partition network with only four layers of conv2d, and randomly set the input, save the model, and put it into autotvm for tuning. However, I encountered the following errors:
Traceback (most recent call last): File “/home/PycharmProjects/vm_project/tune_relay_x86.py”, line 247, in tune_and_evaluate(tuning_option) File “/home/PycharmProjects/vm_project/tune_relay_x86.py”, line 212, in tune_and_evaluate tune_graph(mod[“main”], data_shape, log_file, graph_opt_sch_file) File “/home/PycharmProjects/vm_project/tune_relay_x86.py”, line 192, in tune_graph executor = Tuner(graph, {input_name: dshape}, records, target_op, target) File “/home/software/tvm/python/tvm/autotvm/graph_tuner/dynamic_programming_tuner.py”, line 44, in init super(DPTuner, self).init(*args, **kwargs) File “/home/software/tvm/python/tvm/autotvm/graph_tuner/base_graph_tuner.py”, line 179, in init “operator is one of %s” % self._target_ops RuntimeError: Could not find any input nodes with whose operator is one of [Op(nn.conv2d)]
The network I used is as follows:
class IB(nn.Module):
def __init__(self, in_channels, out_channels):
super(IB, self).__init__()
self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=3, padding=1)
self.bn = nn.BatchNorm2d(out_channels)
self.act = nn.ReLU(inplace=True)
def forward(self, input):
out = self.act(self.bn(self.conv(input)))
return out
class OB(nn.Module):
def __init__(self, in_channels, out_channels):
super(OB, self).__init__()
self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=3, padding=1)
self.bn1 = nn.BatchNorm2d(out_channels)
self.act1 = nn.ReLU(inplace=True)
self.conv2 = nn.Conv2d(out_channels, out_channels, kernel_size=1)
self.softmax = nn.Softmax(dim=1)
def forward(self, input):
out = self.act1(self.bn1(self.conv1(input)))
out = self.conv2(out)
out = self.softmax(out)
return out
class SegNet(nn.Module):
def __init__(self, in_channels, out_channels):
super(SegNet, self).__init__()
self.in_block = IB(in_channels, 4)
self.conv = nn.Conv2d(4, 4, kernel_size=3, stride=1, padding=1)
self.out_block = OB(4, out_channels)
def forward(self, input):
out16 = self.in_block(input)
out16 = self.conv(out16)
out = self.out_block(out16)
return out
Could you help me explain why?@kevinthesun thanks!