creativeguitar:

is it because I am dealing with a nested ordereddict?


No, the error is raised as the tensor type isn’t serializable to JSON directly.
You could create lists with the values first and serialize it afterwards:
model = nn.Linear(10, 10)
od1 = model.state_dict()
od1 = OrderedDict({k: od1[k].detach().cpu().tolist() for k in od1})
od1 = json.dumps(od1)