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

建议对python/paddle/trainer_config_helpers/math.py进行更名 #903

Closed
pengli09 opened this issue Dec 15, 2016 · 2 comments
Closed

建议对python/paddle/trainer_config_helpers/math.py进行更名 #903

pengli09 opened this issue Dec 15, 2016 · 2 comments
Assignees
Labels

Comments

@pengli09
Copy link
Contributor

目前在写网络config时,都会使用from paddle.trainer_config_helpers import *,此时会将python/paddle/trainer_config_helpers/math.py导入命名空间,与python自带的math库发生名字冲突。一方面由此引发报错时很难追查,另一方面如果需要同时使用二者时,会比较麻烦。因此建议对该文件名进行修改,或在python/paddle/trainer_config_helpers/init.py将import math修改为import math as NEW_NAME

该问题已导致SRL demo无法运行:db_lstm.py中先导入系统库math,然后通过from paddle.trainer_config_helpers import * 意外导入paddle.trainer_config_helpers.math,将系统库math覆盖,引起db_lstm.py第116行找不到sqrt()定义。

@reyoung
Copy link
Collaborator

reyoung commented Dec 15, 2016

有道理。

@reyoung reyoung self-assigned this Dec 15, 2016
@reyoung reyoung added the Bug label Dec 15, 2016
reyoung added a commit to reyoung/Paddle that referenced this issue Dec 16, 2016
@pengli09 pengli09 reopened this Dec 22, 2016
@pengli09
Copy link
Contributor Author

#922 的解法还是不能正确解决这个问题,#922 只是又额外引入了一个新名字layer_math,import *的时候还是会把math导入到当前命名空间中。

reyoung added a commit to reyoung/Paddle that referenced this issue Dec 26, 2016
@Noplz Noplz mentioned this issue Jan 13, 2017
zhhsplendid pushed a commit to zhhsplendid/Paddle that referenced this issue Sep 25, 2019
* test=develop, update install doc

* add setuptools dependency

* Update compile_Ubuntu.md

update cudnn version

* Update install_Ubuntu.md

update cudnn version

* Update install_CentOS.md

update cudnn version

* test=develop, refine ubuntu cuda support

* test=develop, refine ubuntu cuda support

* test=develop, refine python support on python3.5

* fix python2 in ubuntu16.04 need gcc 5.4

* add nccl related doc

* refine doc
wangxicoding pushed a commit to wangxicoding/Paddle that referenced this issue Dec 9, 2021
lizexu123 pushed a commit to lizexu123/Paddle that referenced this issue Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants