Skip to content

add relay.frontend.from_oneflow support cnns#1

Merged
BBuf merged 3 commits intomainfrom
oneflow_fronted
Jul 30, 2021
Merged

add relay.frontend.from_oneflow support cnns#1
BBuf merged 3 commits intomainfrom
oneflow_fronted

Conversation

@hhhfccz
Copy link
Copy Markdown

@hhhfccz hhhfccz commented Jul 28, 2021

mobilenetv2,resnet50、alexnet、vgg都是可以的

Comment thread python/tvm/relay/frontend/oneflow.py
Comment thread python/tvm/relay/frontend/oneflow.py
Comment thread python/tvm/relay/frontend/oneflow.py Outdated
dtype=str(node_array.dtype)
)

for node_name in nodes:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

移到上面的for loop里面吧

Comment thread python/tvm/relay/frontend/oneflow.py Outdated

def _parse_input(self, node, model_dir_path):
for input_name in node.user_conf.input:
node_input_name = node.name + '-' + input_name
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 改成 os.path.join

Comment thread python/tvm/relay/frontend/oneflow.py Outdated


def fix_outputs(op_name, outputs):
if op_name.lower() == "Dropout":
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是不是写错了,lower之后应该是dropout

Comment thread python/tvm/relay/frontend/oneflow.py Outdated
{
node1_name:
{
'name': node1_name, # str, like "conv1-in./model_path/Input_0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个name不太对

Comment thread python/tvm/relay/frontend/oneflow.py Outdated
if not freeze_params:
for node_init_name in user_input:
if "Input_0" not in node_init_name:
raise KeyError("the key of user_input should be: name of network layer 1(like \'conv1\') + \'-in\'")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这句提示感觉怪怪的?

Comment thread python/tvm/relay/frontend/oneflow.py Outdated
node = nodes[node_name]
if is_user_op(node):
for input_name in node.user_conf.input:
node_init_name = node_name + '-' + input_name
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.path.join

Comment thread python/tvm/relay/frontend/oneflow.py Outdated
"""
try:
import oneflow
import oneflow.experimental as flow
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把这个exprimental删掉

@BBuf BBuf merged commit 31ee834 into main Jul 30, 2021
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.

2 participants