Coder Social home page Coder Social logo

mgeconvert's Introduction

MegEngine

MegEngine is a fast, scalable, and user friendly deep learning framework with 3 key features.

  • Unified framework for both training and inference
    • Quantization, dynamic shape/image pre-processing, and even derivation with a single model.
    • After training, put everything into your model to inference on any platform with speed and precision. Check here for a quick guide.
  • The lowest hardware requirements
    • The memory usage of the GPU can be reduced to one-third of the original memory usage when DTR algorithm is enabled.
    • Inference models with the lowest memory usage by leveraging our Pushdown memory planner.
  • Inference efficiently on all platforms
    • Inference with speed and high-precision on x86, Arm, CUDA, and RoCM.
    • Supports Linux, Windows, iOS, Android, TEE, etc.
    • Optimize performance and memory usage by leveraging our advanced features.

Installation

NOTE: MegEngine now supports Python installation on Linux-64bit/Windows-64bit/MacOS(CPU-Only)-10.14+/Android 7+(CPU-Only) platforms with Python from 3.6 to 3.9. On Windows 10 you can either install the Linux distribution through Windows Subsystem for Linux (WSL) or install the Windows distribution directly. Many other platforms are supported for inference.

Binaries

To install the pre-built binaries via pip wheels:

python3 -m pip install --upgrade pip
python3 -m pip install megengine -f https://megengine.org.cn/whl/mge.html

Building from Source

How to Contribute

We strive to build an open and friendly community. We aim to power humanity with AI.

How to Contact Us

Resources

License

MegEngine is licensed under the Apache License, Version 2.0

Citation

If you use MegEngine in your publication,please cite it by using the following BibTeX entry.

@Misc{MegEngine,
  institution = {megvii},
  title =  {MegEngine:A fast, scalable and easy-to-use deep learning framework},
  howpublished = {\url{https://github.com/MegEngine/MegEngine}},
  year = {2020}
}

Copyright (c) 2014-2021 Megvii Inc. All rights reserved.

mgeconvert's People

Contributors

a419775258 avatar bigeagle avatar caowgg avatar ceryzhai avatar daisycx avatar dingshaohua960303 avatar lixiangyin666 avatar tpoisonooo avatar yeasoon avatar ysllllll avatar yzchen avatar zhenganghe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mgeconvert's Issues

带bias的linear层转onnx,为什么转换成Gemm+Add?

测试函数为:
test/test_onnx.py/test_linear()

onnx结果:
image

带bias的linear层转换成Gemm+Add,不带bias的linear层转换成Gemm。其中Gemm的bias都是为1维。

是否应该改为:
带bias的linear层转换成Gemm,其中gemm的bias为oc维;
不带bias的linear层转换成Gemm, bias为空?

onnx->mge 需要支持算子

1.需要支持下reducemax\tile;
2.另外Unsqueeze是有问题的;
3.onnx和onnxsim建议安装的版本好像没有,有一些低版本会有bug

RuntimeError: access invalid Maybe value

Hello,

When trying to convert the CREStereo MegEngine model to ONNX, I am facing the below error.
mgeconvert_onnx

Below is the system configuration used
ubuntu 20.04
MegEngine==1.13.0
mgeconvert==0.7.0.dev0
cuda 12.3

torch->onnx->mge过程中的后半段(onnx->mge)的问题

在onnx模型转mge模型时候无法正常运行,卡在下面这个位置点不动了。

from mgeconvert.converters.onnx_to_mge import onnx_to_mge
onnx_to_mge( 'onnx2.onnx', output="mge.mge", )
ONNX Model Producer : pytorch
ONNX Model Producer Version: 1.8
ONNX Model IR Version : 6
ONNX Model OpSet : 11
`

tm convert 到 caffe 参数问题

master源码安装,TracedModule 转换到 caffe 的时候由于参数问题会报错,没有outspec

Traceback (most recent call last):
  File "/home/lvhaoran/.local/bin/convert", line 187, in <module>
    main()
  File "/home/lvhaoran/.local/bin/convert", line 180, in main
    args.func(args)
  File "/home/lvhaoran/.local/bin/convert", line 31, in to_caffe
    args.input, prototxt=args.prototxt, caffemodel=args.caffemodel, outspec=outspec
TypeError: tracedmodule_to_caffe() got an unexpected keyword argument 'outspec'

执行convert mge_to_onnx ... 报错

你好!
如题,报错如下:
convert: error: invalid choice: 'mge_to_onnx' (choose from 'onnx')
但是convert onnx ... 却可以, 请问知道是什么原因吗 ?
谢谢

无法转换一个简单的 UNet

环境

1.系统环境:ubuntu 18.04
2.MegEngine版本:MegEngine 1.1
3.python版本:3.6.9

复现步骤

见代码

请提供关键的代码片段便于追查问题

模型见
https://github.com/megvii-research/PMRID/blob/main/models/net_mge.py

先 dump 一个模型出来

from megengine import jit
net = Network()
net.eval()
img = mge.tensor(np.random.randn(1, 4, 64, 64).astype(np.float32))

@jit.trace(capture_as_const=True)
def f(x):
    out = net(x)
    return out

f(img)
f.dump(
    "net.mge",
    arg_names=['img'],
    optimize_for_inference=False,
    output_names=['pred'],
)

请提供完整的日志及报错信息

在将 #4 自己修掉的情况下运行 megconverter:

python3 -m mgeconvert.utils.convert_onnx  -i net.mge -o net.onnx
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/wangyuzhi/.local/lib/python3.6/site-packages/mgeconvert/utils/convert_onnx.py", line 29, in <module>
    main()
  File "/home/wangyuzhi/.local/lib/python3.6/site-packages/mgeconvert/utils/convert_onnx.py", line 25, in main
    convert_to_onnx(args.input, args.output, graph_name=args.graph, opset=args.opset)
  File "/home/wangyuzhi/.local/lib/python3.6/site-packages/mgeconvert/onnx_converter/onnx_converter.py", line 120, in convert_to_onnx
    model = converter.convert()
  File "/home/wangyuzhi/.local/lib/python3.6/site-packages/mgeconvert/onnx_converter/onnx_converter.py", line 70, in convert
    unsupported_oprs
AssertionError: Operators {<class 'mgeconvert.mge_context.mge_op.ConvolutionBackwardDataOpr'>} are not supported yet

我不了解 ConvolutionBackwardDataOpr 这个 opr 的作用,凭我朴素的理解,我只需要得到这个网络的前向部分,跟 backward 应该没关系……

onnx 模型转换问题

WARNING: The argument dynamic_input_shape=True is not needed any more, onnxsim
can now support dynamic input shapes natively, please refer to the latest
documentation. An error will be raised in the future.

image

找不到cuda_fp16.h

mgeconvert1.0.2版本,onnx模型转mge,报错:

05 09:32:46[mgb] ERR error occurred in computing sequence; synchronizing all comp nodes and releasing vars now ...
RuntimeError: nvrtc compile error: default_program(2): catastrophic error: cannot open source file "cuda_fp16.h"

系统里cuda_fp16.h在/usr/local/cuda-10.1/targets/x86_64-linux/include 这个目录下,请问要如何设置能让mgeconvert找到这个头文件?

ConvolutionBackwardDataOpr 初始化错误

https://github.com/MegEngine/mgeconvert/blob/master/mgeconvert/mge_context/mge_op.py#L302

class ConvolutionBackwardDataOpr(MgeOpr):
    name = "ConvolutionBackwardData"

    def __init__(self, opr):
        super().__init__(opr)
        self.kernel_shape = get_shape(opr.inputs[1])
        self.data_format = opr.params["format"]
        self.dilation_w = opr.params["dilate_w"]
        self.dilation_h = opr.params["dilate_h"]
        self.pad_w = opr.params["pad_w"]
        self.pad_h = opr.params["pad_h"]
        self.stride_w = opr.params["stride_w"]
        self.stride_h = opr.params["stride_h"]
        self.sparse = opr.params["sparse"]

这里应该使用 self.params

.pkl转.onnx有问题

想将CVPR2021的NBNet训练的模型转为.onnx,报错,是否目前仅支持部分网络?
lALPJxf-v_HmYN3NASvNBU0_1357_299

Megengine 1.7.0+cu112

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.