TensorFlow减慢了Jupyter Notebook中的智能感知(类型提示)。

huangapple go评论59阅读模式
英文:

Tensorflow slows intellisense (type-hint) in jupyter notebook

问题

我对TensorFlow相对新手,但类型提示弹出的速度太慢让我有点不耐烦,所以我很好奇是否有人知道如何修复这个问题。

在使用TensorFlow 2.0在vscode jupyter笔记本中时,智能感知下拉框需要多达2秒才会真正出现。这只会在我导入TensorFlow时发生,所以没有其他库会减慢我的智能感知。

我在一台Mac上,使用英特尔芯片作为参考。不是最快的机器,但还行。

  • 重启一切
  • 更新TensorFlow

使用以下两个导入似乎有些帮助:

from tensorflow.keras.layers import Dense, Flatten, Conv2D
from tensorflow.keras import Model
英文:

im fairly new to TensorFlow but type hints taking forever to popup are kinda getting on my nerves now so I was curious if anybody knew any fixes.

while using TensorFlow 2.0 in vscode jupyter notebook the intellisense dropdown takes up to 2 seconds to actually appear. this only happens when I import TensorFlow, so no other library slows down my IntelliSense.

im on a Mac intel chip for reference. not the fastest machine but still.

  • restarting everything
  • updating tensorflow

using these two imports seemed to help a bit

from tensorflow.keras.layers import Dense, Flatten, Conv2D
from tensorflow.keras import Model

答案1

得分: 0

以下是翻译好的内容:

这是我建议你的,重新开始使用在Anaconda上创建的特定虚拟环境,使用Jupyter Notebook和TensorFlow 2.0。仅仅为了这个目的使用TensorFlow 2.0。

这里有详细的指南链接:

https://stackoverflow.com/questions/58944060/anaconda-installs-tensorflow-1-15-instead-of-2-0

英文:

This what i recommend you is to start over with tensorflow with Jupyter notebook with specific virtual environment created on anaconda. Just for that purpose using tensorflow 2.0.

Here is detailed link to instructions:

https://stackoverflow.com/questions/58944060/anaconda-installs-tensorflow-1-15-instead-of-2-0

huangapple
  • 本文由 发表于 2023年2月16日 05:49:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/75465744.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定