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 · 3130 阅读 · 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 · 626 阅读 · 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/79089074 ValueError: The last dimension of the inputs to Dense should be defined. Found None. ppp2.shape: (10, ?) 这种情况是由于 tf.reshape ()时,设原创 2021-04-12 14:57:10 · 7263 阅读 · 0 评论 -
Could not load dynamic library ‘cusolver64_10.dll cudart64_10.dll
问题: >>> import tensorflow as tf 2021-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 · 840 阅读 · 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 · 5199 阅读 · 2 评论
分享