|
다음 판
|
이전 판
|
wiki:ai:python:tensorflow [2020/08/14 11:37] dhan 만듦 |
wiki:ai:python:tensorflow [2023/01/13 18:44] (현재) |
| ====== tensorflow ====== | ====== Tensorflow ====== |
| <WRAP left notice 80%> | <WRAP left notice 80%> |
| * description : tensorflow 관련 내용 기술 | * description : tensorflow 관련 내용 기술 |
| {{:wiki:ai:tensorflow:check-tensorflow-gpu.jpg?direct&600|}} | {{:wiki:ai:tensorflow:check-tensorflow-gpu.jpg?direct&600|}} |
| |
| ==== Ref ==== | ==== Remove ==== |
| | Show |
| | <code bash> |
| | $> pip3 show tensorflow |
| | </code> |
| | Uninstall |
| | <code bash> |
| | sudo pip3 uninstall tensorflow-gpu |
| | </code> |
| | \\ |
| | ==== Upgrade ==== |
| | <code bash> |
| | sudo pip3 install --upgrade tensorflow-cpu |
| | </code> |
| |
| [[https://jaehyeongan.github.io/2019/05/01/tensorflow%20GPU버전%20사용하기|tensorflow GPU 사용하기]] | [[https://jaehyeongan.github.io/2019/05/01/tensorflow%20GPU버전%20사용하기|tensorflow GPU 사용하기]] |
| ===== Tip ===== | ===== Tip ===== |
| [[http://solarisailab.com/archives/2640|33. TensorFlow 2.0 Release 및 변경사항 정리 – Tf.Session & Tf.Placeholder 삭제, @Tf.Function, Tf_upgrade_v2]] \\ | [[http://solarisailab.com/archives/2640|33. TensorFlow 2.0 Release 및 변경사항 정리 – Tf.Session & Tf.Placeholder 삭제, @Tf.Function, Tf_upgrade_v2]] \\ |
| | SyntaxError regarding async when attempting to jupyter |
| | <code python> |
| | dhan@dhan-linux:~$ jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root |
| | [I 17:59:50.050 NotebookApp] Writing notebook server cookie secret to /home/dhan/.local/share/jupyter/runtime/notebook_cookie_secret |
| | Traceback (most recent call last): |
| | File "/home/dhan/.local/bin/jupyter-notebook", line 8, in <module> |
| | sys.exit(main()) |
| | File "/home/dhan/.local/lib/python3.8/site-packages/jupyter_core/application.py", line 270, in launch_instance |
| | return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) |
| | File "/home/dhan/.local/lib/python3.8/site-packages/traitlets/config/application.py", line 663, in launch_instance |
| | app.initialize(argv) |
| | File "<decorator-gen-7>", line 2, in initialize |
| | File "/home/dhan/.local/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in catch_config_error |
| | return method(app, *args, **kwargs) |
| | File "/home/dhan/.local/lib/python3.8/site-packages/notebook/notebookapp.py", line 2037, in initialize |
| | self.init_webapp() |
| | File "/home/dhan/.local/lib/python3.8/site-packages/notebook/notebookapp.py", line 1675, in init_webapp |
| | self.web_app = NotebookWebApplication( |
| | File "/home/dhan/.local/lib/python3.8/site-packages/notebook/notebookapp.py", line 183, in __init__ |
| | settings = self.init_settings( |
| | File "/home/dhan/.local/lib/python3.8/site-packages/notebook/notebookapp.py", line 302, in init_settings |
| | nbextensions_path=jupyter_app.nbextensions_path, |
| | File "/home/dhan/.local/lib/python3.8/site-packages/notebook/notebookapp.py", line 1292, in nbextensions_path |
| | from IPython.paths import get_ipython_dir |
| | File "/home/dhan/.local/lib/python3.8/site-packages/IPython/__init__.py", line 55, in <module> |
| | from .core.application import Application |
| | File "/home/dhan/.local/lib/python3.8/site-packages/IPython/core/application.py", line 25, in <module> |
| | from IPython.core import release, crashhandler |
| | File "/home/dhan/.local/lib/python3.8/site-packages/IPython/core/crashhandler.py", line 27, in <module> |
| | from IPython.core import ultratb |
| | File "/home/dhan/.local/lib/python3.8/site-packages/IPython/core/ultratb.py", line 116, in <module> |
| | from IPython.utils import path as util_path |
| | File "/home/dhan/.local/lib/python3.8/site-packages/IPython/utils/path.py", line 17, in <module> |
| | from IPython.utils.process import system |
| | File "/home/dhan/.local/lib/python3.8/site-packages/IPython/utils/process.py", line 19, in <module> |
| | from ._process_posix import system, getoutput, arg_split, check_pid |
| | File "/home/dhan/.local/lib/python3.8/site-packages/IPython/utils/_process_posix.py", line 23, in <module> |
| | import pexpect |
| | File "/usr/lib/python3/dist-packages/pexpect/__init__.py", line 75, in <module> |
| | from .pty_spawn import spawn, spawnu |
| | File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 14, in <module> |
| | from .spawnbase import SpawnBase |
| | File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 224 |
| | def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False): |
| | ^ |
| | SyntaxError: invalid syntax |
| | </code> |
| | 해결법 |
| | <code python> |
| | $> sudo apt-get remove python-pexpect python3-pexpect |
| | $> sudo pip3 install --upgrade pexpect |
| | </code> |
| | [[https://askubuntu.com/questions/1106943/syntaxerror-regarding-async-when-attempting-to-run-jupyter-in-python-3-7]] \\ |
| | \\ |
| | ModuleNotFoundError: No module named 'pexpect' |
| | <code> |
| | dhan@dhan-linux:~$ ipython |
| | ..... |
| | ..... |
| | ModuleNotFoundError: No module named 'pexpect' |
| | </code> |
| | 해결법 |
| | <code python> |
| | pip install -I pexpect |
| | python -c 'import pexpect' |
| | </code> |
| | [[https://github.com/facebookresearch/DrQA/issues/9]]\\ |
| | \\ |
| ===== Troubleshooting ===== | ===== Troubleshooting ===== |
| |