以下代码在tensorflow r1.12 python API中生成警告:
#!/usr/bin/python3
import tensorflow as tf
M = tf.keras.models.Sequential();
M.add(tf.keras.layers.Dense(2));
Run Code Online (Sandbox Code Playgroud)
完整的警告文本是这样的:
WARNING: Logging before flag parsing goes to stderr.
W0213 15:50:07.239809 140701996246848 deprecation.py:506] From /home/matias/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/init_ops.py:1253: calling VarianceScaling.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Call initializer instance with the dtype argument instead of passing it to the constructor
Run Code Online (Sandbox Code Playgroud)
我尝试了不同的方法,例如在添加Dense层并将其传递给Dense构造函数之前初始化和调用内核初始化程序,但是它似乎没有任何改变。这是不可避免的警告吗?对我来说,回答“是”就足够了。
我一直在使用Image来打开和获取像素信息,并阅读过诸如“ PIL是未来和blabla ..”之类的内容,但是我已经看到skimage被广泛使用。
我应该使用哪一个进行常规图像处理?对于这个问题,我会感到更自在。
我正在学习在OpenCL中制作健壮的代码,并面对以下内核代码:
string kernel_code =
" void kernel simple_add(global const int *A, "
" global const int *B, "
" global int *C, int n) { "
" "
" int index = get_global_id(0); "
" C[index]=A[index]+B[index]; "
" } ";
Run Code Online (Sandbox Code Playgroud)
并故意使用以下代码将其发送到GPU:
Kernel ker(program, "simple_add");
ker.setArg(0, buffer_A);
ker.setArg(1, buffer_B);
ker.setArg(2, buffer_C);
ker.setArg(3, N);
q.enqueueNDRangeKernel(ker,NullRange,NDRange(32),NDRange(32));
q.finish();
Run Code Online (Sandbox Code Playgroud)
问题是,我使用的工作项超过了需要的工作,因此,我认为我应该检查索引是否超出内核代码的范围。但是我没有使用它,检查enqueueNDRangeKernel或完成返回的错误使我得到CL_SUCCESS。