Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAML模型 #3

Open
jerryLee80 opened this issue May 14, 2020 · 8 comments
Open

DAML模型 #3

jerryLee80 opened this issue May 14, 2020 · 8 comments

Comments

@jerryLee80
Copy link

请问DAML模型实现了吗?我在运行的时候,第一次循环就提示GPU内存溢出(错误应该发生在loss.backward()处,但我未找出原因),而其他2个模型都是可以正常运行的。

@ShomyLiu
Copy link
Owner

你好!
DAML是实现了的。 但是由于DAML是完全的Context-aware,需要维护一个大矩阵,因此占用显存会大一些。建议改小batch_size

@jerryLee80
Copy link
Author

谢谢。我看默认是64,以前改过32,还是报错,所以没再改小了。我用的是1080Ti。另外,能再将num_fea取值为1,2,3的含义解释下吗?非常感谢。

@ShomyLiu
Copy link
Owner

DAML可以试试小数据集,比如Musical,Office等。
一般feature有三类:

  • ID Embedding 也有叫rating-interaction feature
  • review-level feature
  • document-level feature
    所以num_fea就是模型利用feature个数。 比如DeepCoNN 只利用了document-level所以num_fea=1.

相关说明会更新到readme中。

@jerryLee80
Copy link
Author

感谢!batch_size改为24,基本就可以了。
期待新模型的加入及详细说明的更新。

@luoxintao
Copy link

谢谢。我看默认是64,以前改过32,还是报错,所以没再改小了。我用的是1080Ti。另外,能再将num_fea取值为1,2,3的含义解释下吗?非常感谢。

16G的显卡,batchsize改为32才跑起来。。

@yinzhiqiangluvlzx
Copy link

楼主,方便请教一个问题嘛。python3 main.py test --pth_path="./checkpoints/THE_PTH_PATH" --model=DeepCoNN
这个命令是需要把THE_PTH_PATH替换成保存模型的名字是吧。但是pth_path = "" # the saved pth path for test 这个写成了保存模型的路径依然报错,你有遇到过这种情况么?或者你可以跟我说下你那个测试集是怎么启动的么。十分感谢啦

@FKCHAN
Copy link

FKCHAN commented Dec 23, 2020

你好,因为跑不起来,所以用了三块显卡并行,但是保存模型的时候报错了,
AttributeError: 'DataParallel' object has no attribute 'save'

@ShomyLiu
Copy link
Owner

@FKCHAN 你好, DataParallel 包装的模型 不能直接使用save 来保存模型, 参考:https://pytorch.org/tutorials/beginner/saving_loading_models.html#saving-torch-nn-dataparallel-models

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants