Hello, I want to optimise a model but I meet the error:

Traceback (most recent call last):
File “mobile_test.py”, line 129, in 
data_loader,bn_list[0],net_config))
File “mobile_test.py”, line 62, in prepare_subnet
script_subnet = torch.jit.script(subnet)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/_script.py”, line 943, in script
obj, torch.jit._recursive.infer_methods_to_compile
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/_recursive.py”, line 391, in create_script_module
return create_script_module_impl(nn_module, concrete_type, stubs_fn)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/_recursive.py”, line 448, in create_script_module_impl
script_module = torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/_script.py”, line 391, in _construct
init_fn(script_module)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/_recursive.py”, line 428, in init_fn
scripted = create_script_module_impl(orig_value, sub_concrete_type, stubs_fn)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/_recursive.py”, line 404, in create_script_module_impl
property_stubs = get_property_stubs(nn_module)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/_recursive.py”, line 697, in get_property_stubs
properties_asts = get_class_properties(module_ty, self_name=“RecursiveScriptModule”)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 153, in get_class_properties
getter = get_jit_def(prop[1].fget, f"__{prop[0]}_getter", self_name=self_name)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 271, in get_jit_def
return build_def(ctx, fn_def, type_line, def_name, self_name=self_name)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 305, in build_def
build_stmts(ctx, body))
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 129, in build_stmts
stmts = [build_stmt(ctx, s) for s in stmts]
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 129, in 
stmts = [build_stmt(ctx, s) for s in stmts]
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 279, in call
return method(ctx, node)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 445, in build_Return
return Return(r, None if stmt.value is None else build_expr(ctx, stmt.value))
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 279, in call
return method(ctx, node)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 781, in build_Dict
return DictLiteral(range, [build_expr(ctx, e) for e in expr.keys],
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 781, in 
return DictLiteral(range, [build_expr(ctx, e) for e in expr.keys],
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 278, in call
raise UnsupportedNodeError(ctx, node)
File “/home/yuantian/.local/lib/python3.6/site-packages/torch/jit/frontend.py”, line 111, in init
source_range = ctx.make_range(offending_node.lineno,
AttributeError: ‘NoneType’ object has no attribute ‘lineno’

And this is my code:

fuse_model(subnet)
#quantize model
subnet.qconfig = torch.quantization.default_qconfig
subnet.qconfig = torch.quantization.get_default_qconfig(‘qnnpack’)
torch.backends.quantized.engine = ‘qnnpack’
torch.quantization.prepare(subnet, inplace=True)
#Calibrate
print(‘Calibrating…’)
#evaluate_ofa_subnet(subnet,
#imagenet_data_path, net_config, data_loader, batch_size=16)
#Convert model
torch.quantization.convert(subnet, inplace=True)
#optimize
script_subnet = torch.jit.script(subnet)
script_subnet_optimized = optimize_for_mobile(script_subnet)
return script_subnet_optimized

My code’s link is here:

time - Google Drive

You can run test.py file to run and should run the same error as me.
So how to solve it?
Kind regards.