1.TF.VARIABLE、TF.GET_VARIABLE、TF.VARIABLE_SCOPE以及TF.NAME_SCOPE关系
- 详解
- tf.Variable的变量名是一个可选项,tf.get_variable必须指定变量名,因为tf.get_variable如果存在就不新建
- TensorFlow中通过变量名获取变量的机制主要是通过tf.get_variable和tf.variable_scope实现的。reuse=False时,tf.variable_scope创建变量;reuse=True时,tf.variable_scope获取变量。
- tf.get_variable函数不受tf.name_scope的影响。
2.使用卷积和优化器就段错误
- 版本不对
| tf版本 | python版本 | gcc版本 | 构建工具 | cuDNN | CUDA |
|---|---|---|---|---|---|
| tensorflow-2.1.0 | 2.7、3.5-3.7 | GCC 7.3.1 | Bazel 0.27.1 | 7.6 | 10.1 |
| tensorflow-2.0.0 | 2.7、3.3-3.7 | GCC 7.3.1 | Bazel 0.26.1 | 7.4 | 10.0 |
| tensorflow_gpu-1.15.0 | 2.7、3.3-3.7 | GCC 7.3.1 | Bazel 0.26.1 | 7.4 | 10.0 |
| tensorflow_gpu-1.14.0 | 2.7、3.3-3.7 | GCC 4.8 | Bazel 0.24.1 | 7.4 | 10.0 |
| tensorflow_gpu-1.13.1 | 2.7、3.3-3.7 | GCC 4.8 | Bazel 0.19.2 | 7.4 | 10.0 |
| tensorflow_gpu-1.12.0 | 2.7、3.3-3.6 | GCC 4.8 | Bazel 0.15.0 | 7 | 9 |
| tensorflow_gpu-1.11.0 | 2.7、3.3-3.6 | GCC 4.8 | Bazel 0.15.0 | 7 | 9 |
3.Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
- 显存不够,使用以下代码:
- gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.1)
- sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))
1029



被折叠的 条评论
为什么被折叠?



