Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Error: Could not convert downloaded file into Torch Module #41

Closed
JohnZcp opened this issue Feb 3, 2022 · 1 comment
Closed

Error: Could not convert downloaded file into Torch Module #41

JohnZcp opened this issue Feb 3, 2022 · 1 comment

Comments

@JohnZcp
Copy link

JohnZcp commented Feb 3, 2022

Version

0.1.2

Problem Area

react-native-pytorch-core (core package)

Steps to Reproduce

I am trying to run my custom model in my project, and the model file couldn't convert into Torch Module. I used and modified the export.py from the Yolo_v5 GitHub, to convert my model file type from .pt to .ptl. So far, I didn't found too much info about this error. I checked the model.live.spec.json file, and found that it is different than the example in the tutorial.

Here is the context of the json file for my model.ptl:
{'model/live.spec.json': '{"shape": [1, 3, 640, 640], "stride": 32, "names": ["Parking Sign"]}'}

Here is the example in the tutorial:
{
"pack": {
"type": "tensor_from_image",
"image": "image",
"transforms": [
{
"type": "image_to_image",
"name": "center_crop"
},
{
"type": "image_to_image",
"name": "scale",
"width": 224,
"height": 224
},
{
"type": "image_to_tensor",
"name": "rgb_norm",
"mean": [0.485, 0.456, 0.406],
"std": [0.229, 0.224, 0.225]
}
]
},
"unpack": {
"type": "argmax",
"dtype": "float",
"key": "maxIdx",
"valueKey": "confidence"
}
}

I guess that I suppose to have "pack" and "unpack" in my json file (like in the example). If anyone know or met this error before, please let me know how to fix it. Thanks!

Expected Results

No response

Code example, screenshot, or link to repository

No response

@JohnZcp
Copy link
Author

JohnZcp commented Feb 6, 2022

Currently, I am trying to write the spec.json for yolo_v5. The result i can obtain from my model is an object. I wonder does the pytorch live accept this kind of value from the model?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant