pytorch2keras
pytorch2keras copied to clipboard
keyError:'31_np'
Describe the bug KeyError: '31_np'.
To Reproduce `class PCN2(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 20, kernel_size=3, stride=1)
self.conv2 = nn.Conv2d(20, 40, kernel_size=3, stride=1)
self.conv3 = nn.Conv2d(40, 70, kernel_size=2, stride=1)
self.fc = nn.Linear(70*3*3, 140)
self.rotate = nn.Linear(140, 3)
self.cls_prob = nn.Linear(140, 2)
self.bbox = nn.Linear(140, 3)
self.mp = nn.MaxPool2d(kernel_size=3, stride=2)
def forward(self, x):
batch_size = x.size(0)
x = self.conv1(x)
x = F.pad(x, (0, 1, 0, 1))
x = F.relu(self.mp(x), inplace=True)
x = self.conv2(x)
x = F.pad(x, (0, 1, 0, 1))
x = F.relu(self.mp(x), inplace=True)
x = F.relu(self.conv3(x), inplace=True)
x = x.view(batch_size, -1)
x = F.relu(self.fc(x), inplace=True)
cls_prob = F.softmax(self.cls_prob(x), dim=1)
rotate = F.softmax(self.rotate(x), dim=1)
bbox = self.bbox(x)
return cls_prob, rotate, bbox`
Expected behavior
graph node: PCN2
node id: 32
type: onnx::Reshape
inputs: ['27', '31']
outputs: ['PCN2']
name in state_dict: 27.31
attrs: {}
is_terminal: False
Converting reshape ...
Traceback (most recent call last):
File "D:/Projects/pcn/convert_pb.py", line 57, in
Logs If applicable, add error message to help explain your problem.
Environment (please complete the following information):
- win10: [e.g. iOS]
- Python3 [e.g. Python 2, Python 3]
- Version [e.g. v0.1.11]
Additional context Add any other context about the problem here.
Hey @Dreamgang.
Please, update your pytorch2keras
package to the latest and try again.
pip install --upgrade pytorch2keras
Hey @ @nerox8664 I've updated the pytorch2keras package to the latest, and the errors still exists.
Hello @Dreamgang. I updated tracing module, so, you can check if the problem still exist.