Xilinx / finn-base

Open Source Compiler Framework using ONNX as Frontend and IR
https://finn-base.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
29 stars 17 forks source link

Cannot retrieve ONNX model via URL #58

Closed mmrahorovic closed 2 years ago

mmrahorovic commented 2 years ago

Problem

Trying to retrieve an ONNX model via an URL fails. The returned .onnx model is not complete and when trying to wrap, an error message is returned saying: google.protobuf.message.DecodeError: Protobuf decoding consumed too few bytes: 84 out of 184640.

Specifically:

import urllib.request as ureq
from finn.core.modelwrapper import ModelWrapper

download_url = "https://github.com/onnx/models/tree/main/vision/classification"
download_url += "/shufflenet/model/shufflenet-9.onnx"
export_onnx_path = download_url.split("/")[-1]
ureq.urlretrieve(download_url, export_onnx_path)

model = ModelWrapper(export_onnx_path)

Desired behaviour

To be able to download the complete ONNX model without HTML markup.

maltanar commented 2 years ago

Thanks for flagging this. Addressed by #57 which is now merged into dev. For future reference, the correct URL format to retrieve the raw data for these test ONNX models now looks like https://github.com/onnx/models/raw/main/vision/classification (so "raw" instead of "tree").