Closed HansolEom closed 2 years ago
Can you check if member function set_swish() is in self.artifacts.model of your code? (I'm newbie in BentoML, and I've only used pytorch)
From your error message, Bento seems to be using EfficientNet in pytorch. _(File "/opt/anaconda3/envs/bento/lib/python3.7/site-packages/efficientnetpytorch/) For export this model, you should set_swish(memory_efficient=False).
You can refer "https://github.com/lukemelas/EfficientNet-PyTorch/blob/master/efficientnet_pytorch/model.py", _def set_swish(self, memory_efficient=True): """Sets swish function as memory efficient (for training) or standard (for export). Args: memory_efficient (bool): Whether to use memory-efficient version of swish. """ self._swish = MemoryEfficientSwish() if memoryefficient else Swish()
This doesn't seem like a BentoML issue. You can try out the recent rc releases as we changed the API quite a bit.
Install the latest rc releases with pip install --pre -U bentoml
Feel free to open this again. Closing for now.
I use PytorchLightningModelArtifact. I get this problem:
when doing model.pack. If i use the torch model in pytorch lightning, this problem does not occur. For what reason?
error code:
torchmodel code:
my env: bentoml = 013.1 pytorch = 1.10.1 pytorch-lightning = 1.5.7