serving
serving copied to clipboard
error: #"sbp"<"parallel<[] -> [[#sbp.B]]>"> : 'none' attribute created with unregistered dialect. If this is intended, please call allowUnregisteredDialects() on the MLIRContext, or use -allow-unregistered-dialect with the MLIR opt tool used
按照官方教程示例将模型以图形式保存后,部署至Triton服务中时出现异常。 程序:
import oneflow as flow
import oneflow.nn as nn
from flowvision.models.alexnet import alexnet
class MyGraph(nn.Graph):
def __init__(self, model):
super().__init__()
self.model = model
def build(self, *input):
return self.model(*input)
if __name__ == "__main__":
fake_image = flow.ones((1, 3, 256, 256))
model = alexnet(pretrained=True, progress=True)
model.eval()
graph = MyGraph(model)
out = graph(fake_image)
MODEL_SAVE_DIR = "./alexnet"
import os
if not os.path.exists(MODEL_SAVE_DIR):
os.makedirs(MODEL_SAVE_DIR)
flow.save(graph, MODEL_SAVE_DIR)
异常截图:
