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
However, the running code reports the following error:
D:\ProgramData\Anaconda3\envs\tensorflow1\python.exe E:/code/MAD-GANs-master/RGAN.py
Traceback (most recent call last):
File "E:/code/MAD-GANs-master/RGAN.py", line 9, in
import data_utils
File "E:\code\MAD-GANs-master\data_utils.py", line 9, in
import model
File "E:\code\MAD-GANs-master\model.py", line 14, in
from differential_privacy.dp_sgd.dp_optimizer import dp_optimizer
File "E:\code\MAD-GANs-master\differential_privacy\dp_sgd\dp_optimizer\dp_optimizer.py", line 30, in
class DPGradientDescentOptimizer(tf.train.GradientDescentOptimizer):
AttributeError: module 'tensorflow._api.v2.train' has no attribute 'GradientDescentOptimizer'
Process finished with exit code 1
Please help solve it.
You can also run commands in the project environment:
pip freeze > D:\requirements.txt
Please share the requirements.txt content. Thank you very much!
The text was updated successfully, but these errors were encountered:
I'm sorry,I try some requirements but I haven't suceed.
At 2021-11-17 11:49:06, "Adapter525" ***@***.***> wrote:
have you suceed ?can you share your requirements?thank you 。
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
Please refrain from spamming under unrelated issues.
So about your problem, you are using tensorflow==2.3.0 while this code was written in tensorflow==1.x.x which is likely the cause for you issue. So you can try out the last v1 release tensorflow==1.15.0. As this is based on RGAN, you can check out their requirement.txt as well.
What are the requirements for the code project environment of this program example?
My engineering environment is as follows:
absl-py @ file:///C:/ci/absl-py_1615411229697/work
argon2-cffi @ file:///C:/ci/argon2-cffi_1613037959010/work
astunparse==1.6.3
async-generator @ file:///home/ktietz/src/ci/async_generator_1611927993394/work
attrs @ file:///tmp/build/80754af9/attrs_1620827162558/work
backcall @ file:///home/ktietz/src/ci/backcall_1611930011877/work
bleach @ file:///tmp/build/80754af9/bleach_1612211392645/work
blinker==1.4
Bottleneck==1.3.2
brotlipy==0.7.0
cachetools @ file:///tmp/build/80754af9/cachetools_1619597386817/work
certifi==2021.5.30
cffi @ file:///C:/ci/cffi_1613247279197/work
chardet @ file:///C:/ci/chardet_1607690654534/work
click @ file:///tmp/build/80754af9/click_1620867881259/work
colorama @ file:///tmp/build/80754af9/colorama_1607707115595/work
cryptography @ file:///C:/ci/cryptography_1616769344312/work
decorator @ file:///tmp/build/80754af9/decorator_1621259047763/work
defusedxml @ file:///tmp/build/80754af9/defusedxml_1615228127516/work
entrypoints==0.3
gast @ file:///tmp/build/80754af9/gast_1597433534803/work
google-auth @ file:///tmp/build/80754af9/google-auth_1600960338579/work
google-auth-oauthlib @ file:///tmp/build/80754af9/google-auth-oauthlib_1617120569401/work
google-pasta==0.2.0
grpcio @ file:///C:/ci/grpcio_1613114363102/work
h5py==2.10.0
idna @ file:///home/linux1/recipes/ci/idna_1610986105248/work
importlib-metadata @ file:///C:/ci/importlib-metadata_1617877484576/work
ipykernel @ file:///C:/ci/ipykernel_1596190155316/work/dist/ipykernel-5.3.4-py3-none-any.whl
ipython @ file:///C:/ci/ipython_1617121002983/work
ipython-genutils @ file:///tmp/build/80754af9/ipython_genutils_1606773439826/work
ipywidgets @ file:///tmp/build/80754af9/ipywidgets_1610481889018/work
jedi==0.17.0
Jinja2 @ file:///tmp/build/80754af9/jinja2_1621238361758/work
jsonschema @ file:///tmp/build/80754af9/jsonschema_1602607155483/work
jupyter==1.0.0
jupyter-client @ file:///tmp/build/80754af9/jupyter_client_1616770841739/work
jupyter-console @ file:///tmp/build/80754af9/jupyter_console_1616615302928/work
jupyter-core @ file:///C:/ci/jupyter_core_1612213356021/work
jupyterlab-pygments @ file:///tmp/build/80754af9/jupyterlab_pygments_1601490720602/work
jupyterlab-widgets @ file:///tmp/build/80754af9/jupyterlab_widgets_1609884341231/work
Keras-Applications @ file:///tmp/build/80754af9/keras-applications_1594366238411/work
Keras-Preprocessing @ file:///tmp/build/80754af9/keras-preprocessing_1612283640596/work
Markdown @ file:///C:/ci/markdown_1614364121613/work
MarkupSafe @ file:///C:/ci/markupsafe_1620985253985/work
mistune==0.8.4
mkl-fft==1.3.0
mkl-random @ file:///C:/ci/mkl_random_1618854156666/work
mkl-service==2.3.0
nbclient @ file:///tmp/build/80754af9/nbclient_1614364831625/work
nbconvert @ file:///C:/ci/nbconvert_1601914925608/work
nbformat @ file:///tmp/build/80754af9/nbformat_1617383369282/work
nest-asyncio @ file:///tmp/build/80754af9/nest-asyncio_1613680548246/work
notebook @ file:///C:/ci/notebook_1616443715883/work
numexpr @ file:///C:/ci/numexpr_1618856738664/work
numpy @ file:///C:/ci/numpy_and_numpy_base_1620833114945/work
oauthlib==3.1.0
opt-einsum==3.1.0
packaging @ file:///tmp/build/80754af9/packaging_1611952188834/work
pandas @ file:///C:/ci/pandas_1627570330330/work
pandocfilters @ file:///C:/ci/pandocfilters_1605102497129/work
parso @ file:///tmp/build/80754af9/parso_1617223946239/work
pickleshare @ file:///tmp/build/80754af9/pickleshare_1606932040724/work
prometheus-client @ file:///tmp/build/80754af9/prometheus_client_1618088486455/work
prompt-toolkit @ file:///tmp/build/80754af9/prompt-toolkit_1616415428029/work
protobuf==3.14.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser @ file:///tmp/build/80754af9/pycparser_1594388511720/work
Pygments @ file:///tmp/build/80754af9/pygments_1615143339740/work
PyJWT==1.7.1
pyOpenSSL @ file:///tmp/build/80754af9/pyopenssl_1608057966937/work
pyparsing @ file:///home/linux1/recipes/ci/pyparsing_1610983426697/work
pyreadline==2.1
pyrsistent @ file:///C:/ci/pyrsistent_1600141795814/work
PySocks @ file:///C:/ci/pysocks_1605287845585/work
python-dateutil @ file:///home/ktietz/src/ci/python-dateutil_1611928101742/work
pytz @ file:///tmp/build/80754af9/pytz_1612215392582/work
pywin32==227
pywinpty==0.5.7
pyzmq==20.0.0
qtconsole==4.6.0
requests @ file:///tmp/build/80754af9/requests_1608241421344/work
requests-oauthlib==1.3.0
rsa @ file:///tmp/build/80754af9/rsa_1614366226499/work
scipy @ file:///C:/ci/scipy_1618856128765/work
Send2Trash @ file:///tmp/build/80754af9/send2trash_1607525499227/work
sip==4.19.13
six @ file:///C:/ci/six_1605187374963/work
tensorboard @ file:///home/builder/ktietz/aggregate/tensorflow_recipes/ci_te/tensorboard_1614593728657/work/tmp_pip_dir
tensorboard-plugin-wit==1.6.0
tensorflow==2.3.0
tensorflow-estimator @ file:///tmp/build/80754af9/tensorflow-estimator_1599136169057/work/whl_temp/tensorflow_estimator-2.3.0-py2.py3-none-any.whl
termcolor==1.1.0
terminado==0.9.4
testpath @ file:///home/ktietz/src/ci/testpath_1611930608132/work
tornado @ file:///C:/ci/tornado_1606942392901/work
traitlets @ file:///home/ktietz/src/ci/traitlets_1611929699868/work
urllib3 @ file:///tmp/build/80754af9/urllib3_1615837158687/work
wcwidth @ file:///tmp/build/80754af9/wcwidth_1593447189090/work
webencodings==0.5.1
Werkzeug @ file:///home/ktietz/src/ci/werkzeug_1611932622770/work
widgetsnbextension==3.5.1
win-inet-pton @ file:///C:/ci/win_inet_pton_1605306167264/work
wincertstore==0.2
wrapt==1.12.1
zipp @ file:///tmp/build/80754af9/zipp_1615904174917/work
However, the running code reports the following error:
D:\ProgramData\Anaconda3\envs\tensorflow1\python.exe E:/code/MAD-GANs-master/RGAN.py
Traceback (most recent call last):
File "E:/code/MAD-GANs-master/RGAN.py", line 9, in
import data_utils
File "E:\code\MAD-GANs-master\data_utils.py", line 9, in
import model
File "E:\code\MAD-GANs-master\model.py", line 14, in
from differential_privacy.dp_sgd.dp_optimizer import dp_optimizer
File "E:\code\MAD-GANs-master\differential_privacy\dp_sgd\dp_optimizer\dp_optimizer.py", line 30, in
class DPGradientDescentOptimizer(tf.train.GradientDescentOptimizer):
AttributeError: module 'tensorflow._api.v2.train' has no attribute 'GradientDescentOptimizer'
Process finished with exit code 1
Please help solve it.
You can also run commands in the project environment:
pip freeze > D:\requirements.txt
Please share the requirements.txt content. Thank you very much!
The text was updated successfully, but these errors were encountered: