-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Use tempfile for storing temporary checkpoints/params/models #42681
Comments
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~ Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day! |
#42626 fixes part of the unit tests, but there are still many unit tests should be refactored. |
cc: @kolinwei |
dygraph_to_static目录下的所有单测均已替换为 |
Thank @Aurelius84, we will check it ASAP. |
@zlsh80826 How about the check result, could we close this issue? |
Hi @luotao1, |
@jiweibo Could you fix the |
Hi @luotao1, |
@zlsh80826 Thanks for pointing out. We would fix this issue. |
Thank all of you, |
@zlsh80826 This is fixed by #48863 . |
@sneaxiy appreciate your help! |
|
Sure, thanks! |
需求描述 Feature Description
目前 Paddle 實現的多個單測中, 會有儲存 checkpoints 或 inference model 後再讀取的測試, 這類型的測試會將模型儲存, 並在完成單測後刪除。但是多個單測會有暫存檔案同名的問題, 會導致單測同時運行時互相覆蓋掉其他單測的暫存檔案, 導致單測會出現隨機性的失敗。例如: test_dataset 和 test_dataset_consistency_inspection 會使用相同
test_run_with_dump_a.txt
作為暫存檔案,又比如 test_resnet 和 test_build_strategy 都使用相同的resnet.dygraph.params
作為模型暫存檔。在撰寫單測時應該注重單測的孤立性, 單測前後系統的狀態需要盡量保持相同, 最大限度地減少生成檔案或是測試之間的依賴關係, 如果有需要使用暫存檔案, 可以使用
mktemp
或是 python 模塊的tempfile
, 並在單測的tearDown
函式中釋放從系統中取得的資源。替代实现 Alternatives
有用到暫存檔案的單測應該參考類似 test_pass_builder.py 的寫法, 使用 tempfile 模塊底下的函式, 照單測的需求使用對應建立暫存檔案或目錄的 API 來減少單測間的影響。
The text was updated successfully, but these errors were encountered: