Skip to content

Conversation

@maulikmadhavi
Copy link

Upon calling model tracing:

from ofa.model_zoo import ofa_net

ofa_network = ofa_net("ofa_mbv3_d234_e346_k357_w1.0", pretrained=True)
traced_model = torch.jit.trace(ofa_network, torch.randn(1, 3, 224, 224))

I run into the following error:

once-for-all/ofa/imagenet_classification/elastic_nn/modules/dynamic_layers.py in forward(self, x)
    225         if self.inverted_bottleneck is not None:
    226             self.inverted_bottleneck.conv.active_out_channel = make_divisible(
--> 227                 round(in_channel * self.active_expand_ratio),
    228                 MyNetwork.CHANNEL_DIVISIBLE,
    229             )

TypeError: type Tensor doesn't define __round__ method

I replaced round with torch.round.

Thanks
Maulik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant