You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to run this example following the docs at https://federatedscope.io/docs/recommendation/ with the command: python federatedscope/main.py --cfg federatedscope/mf/baseline/hfl-sgdmf_fedavg_standalone_on_movielens1m.yaml
However, it did not run and reported some errors. The error occurred in the file ./federatedscope/mf/trainer/trainer_sgdmf.py. It might be caused by a torch type "Embedding". Specifically, ctx.model.embed_user.grad is incorrect, while ctx.model.embed_user.weight.grad is correct. Additionally, there are some other errors, such as "add(sparse, dense)".
I tried using ChatGPT to fix the code, and now the example can run. I checked my Git history. Here are my fixed records:
In federatedscope/mf/dataset/movielens.py, line 160-161
row = [mapping_user[mid] for _, mid in data["userId"].items()]
col = [mapping_item[mid] for _, mid in data["movieId"].items()]
In federatedscope/mf/trainer/trainer_sgdmf.py line 70, replace all funciton def hook_on_batch_backward(ctx):
I tried to run this example following the docs at https://federatedscope.io/docs/recommendation/ with the command:
python federatedscope/main.py --cfg federatedscope/mf/baseline/hfl-sgdmf_fedavg_standalone_on_movielens1m.yaml
However, it did not run and reported some errors. The error occurred in the file ./federatedscope/mf/trainer/trainer_sgdmf.py. It might be caused by a torch type "Embedding". Specifically, ctx.model.embed_user.grad is incorrect, while ctx.model.embed_user.weight.grad is correct. Additionally, there are some other errors, such as "add(sparse, dense)".
I tried using ChatGPT to fix the code, and now the example can run. I checked my Git history. Here are my fixed records:
In
federatedscope/mf/dataset/movielens.py
, line 160-161In
federatedscope/mf/trainer/trainer_sgdmf.py
line 70, replace all funcitondef hook_on_batch_backward(ctx):
The code can now run, but I’m not sure if there are any other issues.
I rarely use GitHub. I might need to learn how to pull a request later.
Env.:
python 3.9
torch 1.10.1
cuda 11.3
Thank your work. Have a good day. :)
The text was updated successfully, but these errors were encountered: