![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow2
*pprp*
GiantPandaCV公众号作者,研究方向automl,nas
展开
-
call() missing 1 required positional argument xxx
环境:tf2.1报错:call() missing 4 required positional argument x y w h修改:@tf.function( input_signature=( tf.TensorSpec(shape=[None, None, 3], dtype=tf.float32), tf.TensorSpec(shape=[], dtype=tf.int32), tf.TensorSp原创 2021-05-21 10:20:33 · 2841 阅读 · 0 评论 -
使用LineProfiler找出代码的计算瓶颈
实现同样一个功能,笔者运行需要11秒,而同窗的运行仅需要1秒不到,但是实际实现逻辑是类似的,所以需要使用性能分析工具对瓶颈进行分析。安装命令行安装:pip install line_profiler本地下载后安装:https://www.lfd.uci.edu/~gohlke/pythonlibs/#line_profiler根据平台选择对应whl文件,然后本地安装。修改代码先来一个demo,do_stuff是我们的目标,要测试这个函数每一行的耗时。from line_profi原创 2021-04-12 20:10:20 · 379 阅读 · 0 评论 -
The last dimension of the inputs to `Dense` should be defined. Found `None`.
仅仅出现在tf2.1中,在tf2.4中已经不存在该问题。这个问题查询了很多教程都没有很好的解决,其中有一个比较有启发的解决方案是这样的。https://blog.csdn.net/dldldl0/article/details/79089074ValueError: The last dimension of the inputs to Dense should be defined. Found None. ppp2.shape: (10, ?)这种情况是由于 tf.reshape ()时,设原创 2021-04-12 14:57:10 · 6865 阅读 · 0 评论 -
Could not load dynamic library ‘cusolver64_10.dll cudart64_10.dll
问题:>>> import tensorflow as tf2021-04-12 09:40:47.255940: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll>>> tf.test.is_gpu_available()WARNING:tensorflow:From <st原创 2021-04-12 09:48:58 · 685 阅读 · 0 评论 -
tf2报错解决 assertion failed: [predictions must be >= 0] [Condition x >= y did not hold element-wise:]
环境: tf2完整报错如下:tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [predictions must be >= 0] [Condition x >= y did not hold element-wise:] [x (sub_2:0) = ] [[-nan][-nan][-nan]...] [y (Cast_2/x:0) = ] [0] [[{{no原创 2021-04-12 09:34:30 · 4737 阅读 · 2 评论