Error: expected text format semantic version, found a Token

I’m using tvm-0.7.0 on Windows x64, with cuda 10.2. Original codes:

import tvm
from tvm import relay

import numpy as np

from tvm.contrib.download import download_testdata

# PyTorch imports
import torch
import torchvision

import time


model_name = "resnet18"
model = getattr(torchvision.models, model_name)(pretrained=True)
model = model.eval()

# We grab the TorchScripted model via tracing
input_shape = [1, 3, 224, 224]
input_data = torch.randn(input_shape)
scripted_model = torch.jit.trace(model, input_data).eval()

from PIL import Image

img_url = "https://github.com/dmlc/mxnet.js/blob/main/data/cat.png?raw=true"
img_path = download_testdata(img_url, "cat.png", module="data")
img = Image.open(img_path).resize((224, 224))

# Preprocess the image and convert to tensor
from torchvision import transforms

my_preprocess = transforms.Compose(
    [
        transforms.Resize(256),
        transforms.CenterCrop(224),
        transforms.ToTensor(),
        transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
    ]
)
img = my_preprocess(img)
img = np.expand_dims(img, 0)


input_name = "input0"
shape_list = [(input_name, img.shape)]
func, params = relay.frontend.from_pytorch(scripted_model, shape_list)

When running to the final statement, func, params = relay.frontend.from_pytorch(scripted_model, shape_list), an error accurs:

file:1:1: parse error: expected text format semantic version, found a  Token(span=Span(SourceName(D:\myTVM\venv\lib\site-packages\tvm\relay\std/prelude.rly, 000002E9033840F0), 1, 1, 1, 2), token_type=EndOfFile, data=(nullptr))you can annotate it as #[version = "0.0.5"]

What does this mean?

Hi @JackChen2021, I had no problem running your code using the latest tvm. Do you want to clone the tvm github repo and build from the source?

Sure, I downloaded the official tvm-0.7.0 release source code (https://github.com/apache/tvm/archive/refs/tags/v0.7.0.zip) and compiled it on Windows 10 with cuda-10.2.

I encountered the same problem, have you solved it now?Can you share your solution please ?