-
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
add python-related unittest problem in faq document #377
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,3 +177,33 @@ PaddlePaddle的参数使用名字 :code:`name` 作为参数的ID,相同名字 | |
|
||
pip install --upgrade pip | ||
|
||
8. test_PyDataProvider等部分python相关单测过不了 | ||
------------------------------------------------- | ||
|
||
如果出现以下单测过不了的情况: | ||
|
||
.. code-block:: bash | ||
|
||
24 - test_PyDataProvider (Failed) | ||
26 - test_RecurrentGradientMachine (Failed) | ||
27 - test_NetworkCompare (Failed) | ||
28 - test_PyDataProvider2 (Failed) | ||
32 - test_Prediction (Failed) | ||
33 - test_Compare (Failed) | ||
34 - test_Trainer (Failed) | ||
35 - test_TrainerOnePass (Failed) | ||
36 - test_CompareTwoNets (Failed) | ||
37 - test_CompareTwoOpts (Failed) | ||
38 - test_CompareSparse (Failed) | ||
39 - test_recurrent_machine_generation (Failed) | ||
40 - test_PyDataProviderWrapper (Failed) | ||
41 - test_config_parser (Failed) | ||
42 - test_swig_api (Failed) | ||
43 - layers_test (Failed) | ||
|
||
解决办法是:先卸载paddle包 :code:`pip uninstall paddle`,再重新安装 :code:`make install`。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个单测不过也不一定是因为这个原因,有可能就是过不了,还是得看单测的log 然后也不需要重新安装 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 不是一个单测过不了,是以下这些单测都没过的情况,基本上都是因为paddle包没装对。我改一下标题。 |
||
|
||
原因是单元测试使用了一个旧版本的python包,而没有测试到代码中实际修改的python包。即单测需要一个干净的环境(unittest need a clean environment): | ||
|
||
* 如果paddle包已经在python的site-packages里面了,那么单元测试时使用的paddle包,就是site-packages里面的python包,而不是源码目录里 :code:`/python` 目录下的python包。 | ||
* 即便设置了 :code:`PYTHONPATH` 到 :code:`/python` 也没用,因为python的搜索路径是优先已经安装的python包。 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
并且查询paddle单测日志,提示