Hosting Plan for workers showing torchscript error
Further Information
Hi, I am using pysyft 0.2.x and PyGrid. I have hosted a plan that I want to run on Mobile worker. Plan is as follows:
@sy.func2plan()
def evaluate_model_plan(X, y, batch_size, model_params):
# Load model params into the model
set_model_params(model, model_params)
# Test
with th.no_grad():
logits = model(X)
preds = th.argmax(logits, dim=1)
target = th.argmax(y, dim=1)
test_accuracy = preds.eq(target).sum().float() / batch_size
#acc = preds.eq(target).float().mean()
return test_accuracy
test_x = th.randn(3, 28 * 28)
test_y = nn.functional.one_hot(th.tensor([1, 2, 3]), 10)
p = evaluate_model_plan.build(test_x, test_y, 64, model_params)
Plan built successfully. print(evaluate_model_plan.code) displays the code but print(evaluate_model_plan.torchscript.code) , Torchscipt shows the following error.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-126-7912977015b3> in <module>
----> 1 print(evaluate_model_plan.torchscript.code)
AttributeError: 'NoneType' object has no attribute 'code'
Question
Hosting Plan for workers showing torchscript error
Further Information
Hi, I am using pysyft 0.2.x and PyGrid. I have hosted a plan that I want to run on Mobile worker. Plan is as follows:
Plan built successfully. print(evaluate_model_plan.code) displays the code but print(evaluate_model_plan.torchscript.code) , Torchscipt shows the following error.
What can be the issue? I am following https://github.com/OpenMined/PyGrid/blob/dev/examples/model-centric/01-Create-plan.ipynb . Training plan is working fine.
Screenshots
System Information
Additional Context
Add any other context about the problem here.