已移至 Tensorflow 2.0,训练现在在第三步后挂起

2024-03-09

最近我决定从 Tensorflow(GPU 变体)版本 1.14 迁移到当前版本 2.0。

我当前的设置是:

  • Tensorflow(GPU 变体)2.0
  • 库德恩7.6.4
  • CUDA 10
  • Python 3.6
  • 集成开发环境:Visual Studio 2019

我原本以为会有一些疼痛,但这让我措手不及。

当我尝试运行我的一个(现已调整的)1.14 项目时,构建的模型出现了问题,并且训练过程顺利开始。直到第三步之后才彻底停下来。 同一个项目在 Tensorflow 2.0 的 CPU 变体上运行得很好,但训练所有模型需要花费几个数量级的时间。

这是我到目前为止所尝试的:

  • 更改超参数
  • 安装CUDA
  • 安装张量流
  • 重新安装cudnn
  • 禁用验证
  • 检查路径变量

这些都没有对解决问题有任何帮助。我唯一的线索是警告消息:

 Invoking ptxas not supported on Windows
Relying on driver to perform ptx compilation. This message will be only logged once.

我在 Tf 1.14 中从未遇到过这一点,并且对此感到有些困惑。 我知道 CUDA 可以工作,因为我编译并运行了几个 Nvidia 示例。因此,剩下的唯一真正的选择与 Tensorflow 或它如何处理 GPU 相关。

但我不知道如何继续前进。

会话日志如下:

019-11-27 01:03:57.910895: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\pandas\core\frame.py:4117: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  errors=errors,
2019-11-27 01:04:02.247959: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2019-11-27 01:04:02.277414: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce GTX 1070 major: 6 minor: 1 memoryClockRate(GHz): 1.835
pciBusID: 0000:0a:00.0
2019-11-27 01:04:02.282378: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2019-11-27 01:04:02.286653: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2019-11-27 01:04:02.289629: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-11-27 01:04:02.295084: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce GTX 1070 major: 6 minor: 1 memoryClockRate(GHz): 1.835
pciBusID: 0000:0a:00.0
2019-11-27 01:04:02.299843: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2019-11-27 01:04:02.303965: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0
2019-11-27 01:04:03.043700: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-11-27 01:04:03.047132: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]      0
2019-11-27 01:04:03.049453: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0:   N
2019-11-27 01:04:03.052642: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6382 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1070, pci bus id: 0000:0a:00.0, compute capability: 6.1)
Model: "sequential"
_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
embedding (Embedding)        (None, 154, 64)           896000
_________________________________________________________________
conv1d (Conv1D)              (None, 150, 64)           20544
_________________________________________________________________
flatten (Flatten)            (None, 9600)              0
_________________________________________________________________
dense (Dense)                (None, 300)               2880300
_________________________________________________________________
dense_1 (Dense)              (None, 150)               45150
_________________________________________________________________
dense_2 (Dense)              (None, 70)                10570
_________________________________________________________________
dense_3 (Dense)              (None, 10)                710
_________________________________________________________________
dense_4 (Dense)              (None, 2)                 22
=================================================================
Total params: 3,853,296
Trainable params: 3,853,296
Non-trainable params: 0
_________________________________________________________________
Train for 10 steps, validate for 50 steps
Epoch 1/40
2019-11-27 01:04:06.199581: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_100.dll
2019-11-27 01:04:06.430358: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2019-11-27 01:04:07.180709: W tensorflow/stream_executor/cuda/redzone_allocator.cc:312] Internal: Invoking ptxas not supported on Windows
Relying on driver to perform ptx compilation. This message will be only logged once.
2019-11-27 01:04:07.425377: I tensorflow/core/profiler/lib/profiler_session.cc:184] Profiler session started.
2019-11-27 01:04:07.431736: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cupti64_100.dll
 1/10 [==>...........................] - ETA: 32s - loss: 0.6933 - accuracy: 0.4375 - categorical_accuracy: 0.4375 - precision: 0.4375 - recall: 0.43752019-11-27 01:04:07.655586: I tensorflow/core/platform/default/device_tracer.cc:588] Collecting 148 kernel records, 21 memcpy records.
WARNING: Logging before flag parsing goes to stderr.
W1127 01:04:07.730274  5696 callbacks.py:244] Method (on_train_batch_end) is slow compared to the batch update (0.138531). Check your callbacks.
 3/10 [========>.....................] - ETA: 9s - loss: 0.6167 - accuracy: 0.7000 - categorical_accuracy: 0.7000 - precision: 0.7000 - recall: 0.7000

我也受到同样问题的影响。就我而言,问题出在驱动程序上。

我首先尝试使用 CUDA 10 和最新的 NVIDIA 驱动程序来使用tensorflow-gpu,然后在训练步骤中随机卡住,结果只能看到您所显示的 ptxas 内容。

接下来,我将 TensorFlow 版本从 2.0 更改为 1.15 或 1.14,并使用 Python 版本进行调整,发现没有任何帮助。

在卸载驱动程序并安装旧驱动程序 (432.00) 后,问题消失了,但我仍然看到 ptxas 警告。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

已移至 Tensorflow 2.0,训练现在在第三步后挂起 的相关文章

随机推荐

  • xlswrite 如果是向量

    我有一个 mat 文件 其中包含titles time data 和 2 个列向量 time 1 2 3 4 5 and data 10 20 30 40 50 我创建了一个名为 table time data time data 的新单元
  • 如何在 Ruby 中使用 selenium-webdriver/capybara 截取完整浏览器页面及其元素的屏幕截图?

    我正在研究屏幕截图自动化 特别是 我正在努力实现以下目标 提示用户提供网站不同页面的链接 X 提示用户输入类名 Y 我应该能够访问网站 X 登录页面 提供登录详细信息 假设它们已知 单击 提交 按钮 这应该将我重定向到 主页 页面 然后 我
  • AppHarbor可以在构建过程中设置条件编译符号吗?

    AppHarbor可以在构建过程中设置条件编译符号吗 也许很简单 AppHarbor 我有一些测试无法在服务器上运行 它们依赖于测试数据文件 如果 AppHarbor 可以设置条件编译符号 那么当该符号存在时 我可以在测试中添加 Ignor
  • 带自定义滚动条的 Jquery 选项卡式导航

    请参阅新的 更新的问题 https stackoverflow com questions 7423874 jquery navigation and jscrollpane work at first but not after clic
  • 使时间序列在轴上显示最后一个日期?

    所以在 Chart js 中我有一个基于日期范围的时间序列 该图表无法将所有日期显示为轴标签 因此它显示了合理的选择 它始终在左侧显示第一个日期 但并不总是在轴的右端显示最后一个日期 例如 我的日期范围可以是从 1 月 1 日到 7 月 3
  • Java 支持柯里化吗?

    我想知道是否有任何方法可以在 Java 中实现这一点 我认为如果没有对闭包的原生支持 这是不可能的 Java 8 2014 年 3 月 18 日发布 确实支持柯里化 示例 Java 代码发布于Missingfaktor 的回答 https
  • 如何收集任何 java 进程的堆转储

    我是 Heaps 新手 谁能建议我如何获取任何 java 进程 如 Jmeter 的堆转储 我读到了有关 jmap 命令的内容 但我不知道在哪里以及如何执行 编写它 在 Eclipse 或 cmd 中 这可能是一个非常基本的问题 但仍然需要
  • cv::findContours 返回的轮廓是否具有一致的方向?

    我正在使用 OpenCVcv findContours http docs opencv org 2 4 modules imgproc doc structural analysis and shape descriptors html
  • 登录时 BjyAuthorize 未检测到角色

    我正在使用 ZF2 Doctrine ORM 和 BjyAuthorize 问题是 当我登录时 身份的 getRoles 方法返回空 class User implements UserInterface ProviderInterface
  • Oracle - select 语句中的动态列名

    问题 是否可以根据结果集中的值更改 select 语句中的列名称 例如 如果一个year结果集中的值小于1950 为列命名OldYear 否则命名该列NewYear The year结果集中的值保证所有记录都相同 我认为这是不可能的 但这是
  • 如何防止用户使用 dotnet core 和 RESTful API 访问其他用户的数据?

    我正在尝试找到一个没有被广泛讨论的简单问题的最佳解决方案 我的应用程序有很多可以创建和编辑数据的用户 用户应该只查看和编辑他的数据 而不是其他人的数据 想想爱丽丝 她有一家餐厅 A 有一个菜单 MenuA 而鲍勃有一家餐厅 B 有一个菜单
  • 软件可扩展性测试是否有明确的模式?

    我最近对识别软件可扩展性测试的模式非常感兴趣 由于不同软件解决方案的本质不同 可伸缩性测试软件问题的良好解决方案似乎与设计和实现软件的问题一样多 对我来说 这意味着我们可能可以为此类广泛使用的测试提炼出一些模式 为了消除歧义 我会提前说明我
  • 在Mysql表中保存座位安排

    你好 有人可以建议我一种保存座位安排的方法 它是 mysql 表中的 nXm 矩阵 以下是我们如何生成 nXm 表 管理员指定总线的行数和列数 管理员选择矩阵的特定元素是否是 Seat Passage Sleeper 注 一个卧铺占用2个元
  • didSelectRowAtIndexPath 未调用到 cellForRowAtIndex 的 UIButton

    我知道这里有很多关于这个问题的重复项 但我的要求是我在一个单元格上添加了 2 个 UIButtons 并且这两个按钮将打开两个不同的视图 如果我将属性 userInteractionEnabled 设置为 YES 那么它不会从下面的代码中获
  • 使用 Windows 成像组件 (WIC) 的 Delphi 2007

    我需要在Delphi 2007中读取一些大约1 7mb的图片并将其从jpg转换为bmp 有些图片被剪切 灰度或转换后最差 我进行了搜索 但没有找到在 delphi 2007 中添加像 TWicImage 这样的 WIC 例程的技巧 我在某处
  • 在 JSR-310 中计算修改后的儒略日

    如何从 JSR 310 类计算修改后的儒略日 例如LocalDate 在 JDK 8 中 具体来说 这是计算连续计算天数 http en wikipedia org wiki Julian day被称为 修改儒略日 而不是日期儒略历系统 h
  • 当我使用 pip 安装任何包时出现 WinError 10013

    我试图在 Windows 上的 Python 环境中安装软件包 每次这样做时 pip install pacakgename 我收到此错误 Retrying Retry total 4 connect None read None redi
  • 如何在 Visual Studio 中使用 C++ shlwapi 库?

    我的程序使用PathFileExistsW https learn microsoft com windows win32 api shlwapi nf shlwapi pathfileexistsw函数来自shlwapi h includ
  • 控制器如何接收 HttpPost 方法上的参数?

    从控制器中取出此代码片段 例如 public ActionResult Login if User Identity IsAuthenticated return RedirectToAction Index Home else retur
  • 已移至 Tensorflow 2.0,训练现在在第三步后挂起

    最近我决定从 Tensorflow GPU 变体 版本 1 14 迁移到当前版本 2 0 我当前的设置是 Tensorflow GPU 变体 2 0 库德恩7 6 4 CUDA 10 Python 3 6 集成开发环境 Visual Stu