- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Google Colaboratory 使用 TensorFlow 1.15 训练图像识别算法。我已将所有需要的文件上传到 Google 云端硬盘,并已获取运行代码,直到随机播放缓冲区运行完毕。但是,我在对话框中得到一个“^C”,并且无法弄清楚发生了什么。
注意:我之前曾尝试在我的 PC 上训练该算法,并且没有删除上一次训练生成的检查点文件。这可能是问题所在吗?
代码:
!pip install --upgrade pip
!pip install --upgrade protobuf
!pip install tensorflow-gpu==1.15
import tensorflow as tf
print(tf.__version__)
device_name = tf.test.gpu_device_name()
if device_name != '/device:GPU:0':
raise SystemError('GPU device not found')
print('Found GPU at {}'.format(device_name))
!ln -sf /opt/bin/nvidia-smi /usr/bin/nvidia-smi
!pip install gputil
!pip install psutil
!pip install humanize
import psutil
import humanize
import os
import GPUtil as GPU
GPUs = GPU.getGPUs()
gpu = GPUs[0]
def printm():
process = psutil.Process(os.getpid())
print("Gen RAM Free: " + humanize.naturalsize(psutil.virtual_memory().available ), " | Proc size: " + humanize.naturalsize( process.memory_info().rss))
print("GPU RAM Free: {0:.0f}MB | Used: {1:.0f}MB | Util {2:3.0f}% | Total {3:.0f}MB".format(gpu.memoryFree, gpu.memoryUsed, gpu.memoryUtil*100, gpu.memoryTotal))
printm()
from google.colab import drive
#Mount the drive
drive.mount('/content/gdrive')
#Change to working tensorflow directory on the drive
%cd '/content/gdrive/My Drive/weeds/tensorflow_models/models/research/object_detection/'
!apt-get install protobuf-compiler python-pil python-lxml python-tk
!pip install Cython
%cd /content/gdrive/My Drive/weeds/tensorflow_models/models/research/
!protoc object_detection/protos/*.proto --python_out=.
import os
os.environ['PYTHONPATH'] += ':/content/gdrive/My Drive/weeds/tensorflow_models/models/research/:/content/gdrive/My Drive/weeds/tensorflow_models/models/research/slim'
!python setup.py build
!python setup.py install
import time, psutil
Start = time.time() - psutil.boot_time()
Left = 12*3600 - Start
print('Time remaining for this session is: ', Left/3600)
!pip install tf_slim
%cd /content/gdrive/My Drive/weeds/tensorflow_models/models/research/object_detection/
os.environ['PYTHONPATH'] += ':/content/gdrive/My Drive/weeds/tensorflow_models/models/research/:/content/gdrive/My Drive/weeds/tensorflow_models/models/research/slim'
!python train.py --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_coco.config --logtostderr
过程到此结束,但它需要开始使用“全局步骤”训练模型。
2020-10-18 22:42:45.587477: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 168 of 2048
2020-10-18 22:42:55.668973: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 334 of 2048
2020-10-18 22:43:06.067869: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 379 of 2048
2020-10-18 22:43:15.705090: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 503 of 2048
2020-10-18 22:43:26.781151: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 576 of 2048
2020-10-18 22:43:38.120069: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 640 of 2048
2020-10-18 22:43:45.813089: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 708 of 2048
2020-10-18 22:43:58.071040: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 752 of 2048
2020-10-18 22:44:07.506961: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 828 of 2048
2020-10-18 22:44:16.355753: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 908 of 2048
2020-10-18 22:44:25.922348: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 960 of 2048
INFO:tensorflow:global_step/sec: 0
I1018 22:44:34.783342 140291121678080 supervisor.py:1099] global_step/sec: 0
2020-10-18 22:44:36.327813: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1036 of 2048
2020-10-18 22:44:45.651473: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1151 of 2048
2020-10-18 22:44:55.554234: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1186 of 2048
2020-10-18 22:45:05.648568: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1242 of 2048
2020-10-18 22:45:15.644396: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1313 of 2048
2020-10-18 22:45:25.551708: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1386 of 2048
2020-10-18 22:45:35.549003: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1458 of 2048
2020-10-18 22:45:45.648835: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1531 of 2048
2020-10-18 22:45:55.643920: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1602 of 2048
2020-10-18 22:46:05.559702: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1674 of 2048
2020-10-18 22:46:15.547609: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1746 of 2048
2020-10-18 22:46:25.645939: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1819 of 2048
INFO:tensorflow:global_step/sec: 0
I1018 22:46:35.052108 140291121678080 supervisor.py:1099] global_step/sec: 0
2020-10-18 22:46:35.645583: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1891 of 2048
2020-10-18 22:46:45.553851: I tensorflow/core/kernels/data/shuffle_dataset_op.cc:145] Filling up shuffle buffer (this may take a while): 1962 of 2048
^C
我该怎么做才能解决这个问题?训练过程在我的 PC (NVIDA GEFORCE RTX) 上运行良好,但我只需要通过 Google Colab 获得更多计算能力。
最佳答案
我无法运行你的代码,因为你在其中使用了一些文件。但我可以告诉你,这可能是因为你使用的是 TF 1 和 GPU,而在 Colab 中,GPU 降级并不容易。
例如,我没有在您的代码中看到您已经像这样将 CUDA 降级(到您想要的版本):
!wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb
!dpkg -i cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb
!apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub
!apt-get update
!apt-get install cuda=9.0.176-1
您可以通过!nvcc --version
查看CUDA的版本。
并且 Colab 降级 TensorFlow 版本的速度并不快。您可能需要多次重启运行时。
我建议您将代码更改为 TensorFlow 2
关于python - 填充洗牌缓冲区时,Google Colaboratory session 突然结束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64419191/
我开始玩 Colaboratory 但我注意到 shift-tab不会像在 Jupyter 中那样弹出函数的文档字符串。 此功能是否缺失或只是以其他方式访问? 最佳答案 这就是帮助我的原因,例如 图像
运行以下代码时出现奇怪的导入错误。 ! pip install --user --upgrade git+https://github.com/broadinstitute/keras-res
我愚蠢地 (?) pip 安装了 tensorflow-gpu,现在 import tensorflow as tf失败并出现错误(它找不到某些共享库)。有没有办法将环境重置为“出厂设置”? 最佳答案
当我运行 Python Script in Colaboratory ,它正在运行所有以前的代码单元。 有什么方法可以保存以前的单元格状态/输出,我可以在返回笔记本后直接运行下一个单元格。 最佳答案
我发现了很多关于如何将数据上传到 Colaboratory 的提示. 但现在我想做相反的事情 - > 我想下载我在 Colaboratory 工作区中创建的 .csv。 如何做到这一点? 最佳答案 使
是否可以限制 Google Colaboratory 中代码单元输出的行数?至于模仿仅保留最后 n 行的命令外壳的行为? 有时由于调试文本产生的大量文本,浏览器会因为生成的选项卡的大小而崩溃。 是否有
是否可以在 Colaboratory 中使用 Tensorboard。在本地运行 tensorboard 会显示有关模型行为的丰富信息,例如损失等。与 Colaboratory(https://col
我想使用我的本地时间作为 Google Colab 中的系统时间,但我相信默认情况下它设置为 UTC 时间,如下所示: Current Date Format 如何将系统时间更改为本地时间? 最佳答案
我想知道是否可以在 google colaboratory 中添加我的个人片段。 最佳答案 创建一个片段笔记本并在那里写下你的片段(确保在文本块中为每个片段提供一个可搜索的标题 - 请参见下面的屏幕截
我正在尝试将 cifar 数据集上传到谷歌合作。我由 'batches.meta','data_batch_1','data_batch_2','data_batch_3','data_batch_4
我正在 Google Colaboratory 中完成一个教程,作者已经轻松地隐藏了一些解决方案单元格。当您单击隐藏的单元格时,它会展开并变为可见。如何隐藏单元格? 本教程中有一个示例:Creatin
如何合并 Google Colaboratory 中的两个单元格?在 Jupyter Notebook 中,您可以使用 ctrl + shift + m 来实现。 最佳答案 菜单中没有这样的命令。 但
我正在使用谷歌合作实验室用Python教授数据科学,为了让笔记本只留下学生的特定类(class),我想导入一些我们已经编码的基本方法,而不是给他们一个预先填充的大笔记本使用这些方法可以防止任何干扰。
我发现数据表显示很有用,但我有一个警告“警告:总列数 (28) 超过 max_columns (20) 限制为第一个 max_columns”:有没有办法超越?感谢您的任何建议最好的 最佳答案 你可以
我开始尝试Google's Colaboratory 🎉(太酷了!)——这个系统是否期望您每次返回文档时都重新安装任何软件包/我应该预期是否存在已知的超时? 最佳答案 是的,这是预期的行为。 目前,
我正在 Google 的 Colaboratory 中运行一些 Python 脚本平台。现在,我需要设置系统的一些环境变量。如下图所示: !export PATH=drive/app/tf-model
我发现 colaboratory(colab 研究)中的字体大小太小。有没有办法更改代码编辑器的字体大小?我尝试了“首选项”,但没有看到字体大小的选项。 最佳答案 对于 chrome 浏览器,您可以安
Google Colab session 最长会在 12 小时后过期。出于这个原因,我不知道是否值得开始训练我的模型或等到 session 过期再开始一个全新的 session 。 有没有办法知道我的
是否可以安装geoviews在 Google Colaboratory 笔记本上,以便我可以使用它来绘制 Xarray 中的数据数据集? 最佳答案 Geoviews 取决于 cartopy ,其中有一
我最近开始使用 Colaboratory,我正在尝试创建一个新笔记本。 但是,当我尝试打开新笔记本(新 Python 3 笔记本)时,如果出现此错误消息而失败: 笔记本加载错误 加载此笔记本时出错。确
我是一名优秀的程序员,十分优秀!