Comments (8)
The full onnx model can be download from here:
- https://get.ecmwf.int/repository/test-data/ai-models/fuxi/short.onnx
- ONNX External Data: https://get.ecmwf.int/repository/test-data/ai-models/fuxi/short
from onnx2torch.
@ongiaf Do you have any success decoding FuXi (I've been fine-tuning this model for a long time)? I recommend paying attention to this solution
from onnx2torch.
Thanks, it's excellent work.
And with some dirty work, Fuxi can successfully run on PyTorch with Onnx2Torch
. In Onnx2Torch
, problems are mainly about LayerNormalization
and Clip
.
from onnx2torch.
@ongiaf Did you manage to run FuXi with the current weights for the fine-tuning process (I am currently thinking about how to complete the work on the model on a 1-hour grid and thought about freezing some layers except the U-transformer.) ?
from onnx2torch.
Thanks, it's excellent work. And with some dirty work, Fuxi can successfully run on PyTorch with
Onnx2Torch
. InOnnx2Torch
, problems are mainly aboutLayerNormalization
andClip
.
Thank you for posting your changes about Clip. Could you also suggest how to fix LayerNormalization
? Looks like the converted model has issue with torch.layer_norm
call.
from onnx2torch.
@juanqiu1 In order for this to work with FuXi, you will need to change the onnx2torch/node_converters/layer_norm.py
parameter to [1536]:
@add_converter(operation_type='LayerNormalization', version=17)
def _(node: OnnxNode, graph: OnnxGraph) -> OperationConverterResult:
node_attributes = node.attributes
axis = node_attributes.get('axis', AXIS_DEFAULT_VALUE)
epsilon = node_attributes.get('epsilon', EPSILON_DEFAULT_VALUE)
if all(value_name in graph.initializers for value_name in node.input_values[1:]):
input_value_info = graph.value_info[node.input_values[0]]
input_shape = get_shape_from_value_info(input_value_info)
torch_module = nn.LayerNorm(
normalized_shape=(1536), # input_shape[axis:], (this block!)
eps=epsilon,
elementwise_affine=True,
)
from onnx2torch.
@dsuhoi Thank you for hinting, there are a couple of other easy fixes (typing, etc).
Did you manage to run FuXi with the current weights for the fine-tuning process
Do you have any progress on that? After conversion, I loaded model into pytorch but even on A100 with FSDP enabled via accelerate
. I still get CUDA out-of-memory error.
from onnx2torch.
@juanqiu1 Yes, I managed to start the learning process by highlighting the named_parameters()
part within the last dozen UTransformer (this was enough for fine-tunning).
I used Nvidia A100 (40GB).
from onnx2torch.
Related Issues (20)
- Is there a way to remove onnx dependency? HOT 2
- Failed to convert SSDLite with MobileNetV2 backbone
- Unable to successfully convert retinanet R50 HOT 1
- Circular import HOT 1
- Key error 'flow/flow.6/enc/Mul_output_0
- add piper-tts onnx to torch
- NotImplementedError: Converter is not implemented (OperationDescription(domain='', operation_type='BatchNormalization', version=7))
- PermissionError: [Errno 13] Permission denied: 'E:\\onnx2torch\\tmptf9fub_u' HOT 3
- Optimizer got an empty parameter list.
- What is the difference with onnx2pytorch?
- running float16 model on the CPU
- NotImplementedError: Average pool operation with spatial rank == -2 is not implemented
- NotImplementedError: AvgPool with non symmetrical padding is not implemented.
- NotImplementedError: Converter is not implemented (OperationDescription(domain='', operation_type='Loop', version=13)) HOT 1
- Does onnx2torch support dynamic input shape?
- onnx2torch incorrectly omits one weight layer when converting onnx into pytorch.
- NotImplementedError: Converter is not implemented (OperationDescription(domain='', operation_type='If', version=11))
- Problem with input shape
- Not working with yolov5 6.2 and yolov8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onnx2torch.