CSAILVision / semantic-segmentation-pytorch

Pytorch implementation for Semantic Segmentation/Scene Parsing on MIT ADE20K dataset
http://sceneparsing.csail.mit.edu/
BSD 3-Clause "New" or "Revised" License
4.96k stars 1.1k forks source link

how to export the module #253

Open MikeDai2020 opened 4 years ago

MikeDai2020 commented 4 years ago

when i export the UPerNet like this: traced_script_module = torch.jit.trace(segmentation_module, feed_dict['img_data']) traced_script_module.save("seg.pt") it does not work. then i try export the encoder and decoder seperately, like this: encoder = segmentation_module.get_encoder() jit_encoder = torch.jit.trace(encoder, feed_dict['img_data']) jit_encoder.save('encoder.pt') but this assertion failed: assert(isinstance(orig, torch.nn.Module)) AssertionError

any idea?thanks in advance