一、问题现象(附报错日志上下文):
模型使用了Adam作为优化器,GPU和CPU上能正常运行,但NPU平台上报错。
tensorflow.python.framework.errors_impl.InvalidArgumentError: Ref Tensors (e.g., Variables) are not supported as results: tensor ins_fc5/weights:0, dst is Adam/update_ins_fc5/weights/ApplyAdam
二、软件版本:
--CANN版本:CANN_5.0.2
--Tensorflow/Pytorch/MindSpore版本:TensorFlow-1.15
--Python版本:Python 3.7.5
--PycharmToolKit版本:3.0
你好,从目前的报错来看,我怀疑有算子不支持。我们需要收集Debug日志信息。操作方法如下:
https://support.huaweicloud.com/tfmigr-cann503alpha2training/atlasma_13_0004.html#section4
勾选Debugger选项卡然后训练。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
node: FarthestPointSample is not in white list, so currently not support
node: GatherPoint is not in white list, so currently not support
node: QueryBallPoint is not in white list, so currently not support
node: ThreeNN is not in white list, so currently not support
node: PyFunc is not in white list, so currently not support
node: GroupPoint is not in white list, so currently not support
node: ScalarSummary is not in white list, so currently not support
node: ThreeInterpolate is not in white list, so currently not support
node: MergeSummary is not in white list, so currently not support
node: ThreeInterpolateGrad is not in white list, so currently not support
node: _Arg is not in white list, so currently not support
node: _Retval is not in white list, so currently not support
你好,建议你把自定义算子都分析一下,是否能用TF的原生功能API替换? 包括 PyFunc
您好,我之前几个星期研读过该网络有关的三篇论文,这两天又做了些思考和调研,觉得对上述"not in white list"的算子难以用TF原生API替换,具体情况如下:
【1】 FarthestPointSample / GatherPoint / QueryBallPoint / ThreeNN / GroupPoint / ThreeInterpolate / ThreeInterpolateGrad :其中涉及KNN+KD树、类似kmeans聚类的聚合操作、根据特定指标采样(区别于tf支持的random.uniform_candidate_sampler和random.categorical等采样算子)等。所以这块算子的替代可能要从算法层面去复现。
【2】 PyFunc :如果能用tf原生api实现 【1】 中算子,则不需要PyFunc。
【3】 ScalarSummary / MergeSummary :用于数据输出到TensorBoard进行分析,只在train.py中出现,可用stdout的log输出替代。
【4】 _Arg / _Retval :暂未找到这两个算子在网络中的调用位置,猜测是因为tensorflow使用xla_compiler对自定义算子编译时插入导致。(相关问题参考链接:)
所以目前来看,瓶颈应该在于网络用到的核心算子无法用TF原生API直接替换,而modelarts平台也不支持自定义算子。
我目前能想到的解决方案是:从算法层面入手,仅用tensorflow原生算子(或在modelarts平台进行算子开发)重新实现 【1】 中算子,但算子开发的工作量较大,准确性也较难保证;
请问您那边还有什么能从工程上尝试的建议吗?非常感谢!
过期啦。。。可以分享时间长一点吗?
你好同学,你先解决掉当前错误。是不是数据预处理有问题。如果是运行前预处理数据的,建议先把数据处理好作为数据集,运行的时候直接加载处理好的数据呢。
Traceback (most recent call last):
File "/home/ma-user/modelarts/user-job-dir/code/utils/s3dis_utils/dataset_s3dis.py", line 151, in del
while not self.data_sample_queue.empty() and not self.data_queue.empty():
File "", line 2, in empty
File "/home/ma-user/anaconda/lib/python3.7/multiprocessing/managers.py", line 815, in _callmethod
self._connect()
File "/home/ma-user/anaconda/lib/python3.7/multiprocessing/managers.py", line 802, in _connect
conn = self._Client(self._token.address, authkey=self._authkey)
File "/home/ma-user/anaconda/lib/python3.7/multiprocessing/connection.py", line 492, in Client
c = SocketClient(address)
File "/home/ma-user/anaconda/lib/python3.7/multiprocessing/connection.py", line 620, in SocketClient
s.connect(address)
FileNotFoundError: [Errno 2] No such file or directory
好的,谢谢!
已找到FileNotFoundError: [Errno 2] No such file or directory问题所在:原因是代码通过生产-消费者模型多线程读取数据,生产者给出的数据文件路径是从给定的文件中读取的,程序在训练中被ctrl+c或非正常终止时,读取到的数据文件路径与原文件的不一致,所以消费者FileNotFound。这个问题在cpu和gpu下训练过程中被ctrl+c或非正常终止时也会产生。
使用的数据集已经是本地处理好再上传的,根据数据文件路径读取数据,就能开始训练
这个是相关性比较高的issue:#I4EEYB:【应用开发】pointnet++点云模型遇到很多的算子不支持
使用你们提供的算子可能可以解决我的问题,请问这几个算子开发好了吗?
这个是相关性比较高的issue:#I4EEYB:【应用开发】pointnet++点云模型遇到很多的算子不支持
使用你们提供的算子可能可以解决我的问题,请问这几个算子开发好了吗?
@divsigma 今年没希望了。。。
那我先把issue关闭,有其他问题我们再看
登录 后才可以发表评论