ohhhyeahhh / PointAttN

Code for the paper "PointAttN: You Only Need Attention for Point Cloud Completion"
https://ojs.aaai.org/index.php/AAAI/article/view/28356
89 stars 13 forks source link

你好请问为什么会出现类似的问题 #18

Open ruiqiyan opened 1 year ago

ruiqiyan commented 1 year ago

Failed to import tensorflow. INFO - 2023-08-31 20:37:59,198 - test_pcn - Length of test dataset:1200 Loaded compiled 3D CUDA chamfer distance INFO - 2023-08-31 20:38:05,548 - test_pcn - PointAttN's previous weights loaded. INFO - 2023-08-31 20:38:05,550 - test_pcn - Testing... INFO - 2023-08-31 20:38:38,501 - test_pcn - test [0/37] Traceback (most recent call last): File "test_pcn.py", line 108, in test() File "test_pcn.py", line 70, in test if not os.path.isdir(os.path.join(os.path.dirname(args.load_model), 'all', str(label[j]))): IndexError: tuple index out of range

ruiqiyan commented 1 year ago

是由于我没有安装tensorflow吗

WangJun-ZJUT commented 1 year ago

您好!这个问题是超出索引造成的,请检查一下返回的lable是否正常。

ruiqiyan commented 1 year ago

您提供的预训练模型与yaml文件里的num_points: 2048并不相符。应该改为num_points: 16384

ruiqiyan commented 1 year ago

上面的问题已经解决了。但是新出现一个问题在训练的时候报错 /home/user/anaconda3/envs/yrq/lib/python3.8/site-packages/torch/nn/parallel/_functions.py:68: UserWarning: Was asked to gather along dimension 0, but all input tensors were scalars; will instead unsqueeze and return a vector. warnings.warn('Was asked to gather along dimension 0, but all ' Traceback (most recent call last): File "train.py", line 185, in <module> train() File "train.py", line 120, in train val(net, epoch, val_loss_meters, dataloader_test, best_epoch_losses) File "train.py", line 131, in val label, inputs, gt = data ValueError: too many values to unpack (expected 3) 我进行print(data)出现 `/home/user/anaconda3/envs/yrq/lib/python3.8/site-packages/torch/nn/parallel/_functions.py:68: UserWarning: Was asked to gather along dimension 0, but all input tensors were scalars; will instead unsqueeze and return a vector. warnings.warn('Was asked to gather along dimension 0, but all ' [('7', '0', '7', '0', '1', '2', '6', '4', '7', '5', '4', '5', '5', '4', '6', '1', '4', '2', '1', '3', '3', '0', '6', '5', '5', '6', '6', '6', '1', '2', '4', '5', '3', '4', '4', '4', '5', '6', '3', '5', '4', '5', '5', '6', '3', '6', '4', '2', '4', '1', '4', '5', '4', '7', '0', '5', '6', '7', '7', '1', '4', '5', '0', '2'), tensor([[[-2.1883e-01, -4.1176e-01, 2.5427e-04], [-2.1152e-01, -4.1271e-01, 1.0475e-03], [-2.0009e-01, -4.1100e-01, 8.2541e-04], ..., [ 1.5071e-02, -2.5279e-01, 1.2562e-03], [-2.4072e-01, -3.1093e-01, -4.8661e-02], [ 1.0261e-01, -3.1558e-01, 5.0736e-02]],

    [[-2.6206e-02, -1.4550e-01, -9.4322e-02],
     [-2.6737e-02, -1.4558e-01, -8.9228e-02],
     [-2.1950e-02, -1.4649e-01, -7.2474e-02],
     ...,
     [ 8.5404e-02, -1.2251e-01, -1.3743e-01],
     [ 1.2144e-01, -1.3695e-01,  1.4460e-01],
     [ 8.5414e-02, -1.2228e-01, -1.4838e-01]],

    [[-3.8859e-01, -2.4129e-01, -1.0817e-03],
     [-3.7490e-01, -2.3916e-01, -1.0903e-03],
     [-3.9493e-01, -2.3037e-01, -8.4953e-03],
     ...,
     [-2.9609e-01, -1.6744e-01, -6.0065e-02],
     [-4.0206e-01, -1.4619e-01, -3.6619e-02],
     [-4.0894e-01, -1.3678e-01, -2.0342e-02]],

    ...,

    [[ 1.1953e-01, -1.5664e-01, -2.6902e-01],
     [ 1.2348e-01, -1.5437e-01, -2.8757e-01],
     [ 1.2368e-01, -1.5422e-01, -2.5346e-01],
     ...,
     [-1.2703e-01,  1.2075e-01,  4.5678e-02],
     [-7.9317e-02, -1.9235e-02, -4.4013e-01],
     [-1.3213e-01,  1.3807e-01,  1.9007e-01]],

    [[ 1.2130e-02, -1.2740e-01, -8.4754e-02],
     [ 1.2600e-04, -1.2326e-01, -8.4171e-02],
     [ 4.8243e-03, -1.2549e-01, -6.6977e-02],
     ...,
     [-5.5436e-03, -7.9914e-02, -4.1211e-02],
     [ 1.1646e-02, -1.0514e-01, -7.4536e-02],
     [-1.4838e-01, -7.8105e-02, -1.6707e-02]],

    [[ 2.5774e-01, -1.2797e-01,  1.7850e-01],
     [ 2.7796e-01, -1.2200e-01,  1.7719e-01],
     [ 2.7700e-01, -1.2240e-01,  1.6645e-01],
     ...,
     [ 4.3571e-01, -1.7155e-02,  1.7411e-02],
     [-2.1164e-01, -2.6060e-03,  1.8422e-01],
     [ 2.8504e-01, -1.1846e-01,  1.4619e-01]]], dtype=torch.float64), tensor([[[-1.8928e-01, -3.5035e-01, -1.0372e-02],
     [-1.8925e-03, -3.5000e-01,  3.2724e-02],
     [ 9.3562e-03, -3.4822e-01,  3.1706e-02],
     ...,
     [ 3.0664e-02, -3.4822e-01,  3.3305e-04],
     [-1.2526e-01, -3.1894e-01,  1.4886e-02],
     [-2.2527e-01, -3.2315e-01, -1.9732e-02]],

    [[-2.2632e-01, -1.7633e-02, -2.9077e-03],
     [ 8.2751e-03, -4.4142e-02, -1.1191e-01],
     [ 2.1100e-01, -4.8467e-02,  3.4728e-02],
     ...,
     [-2.6098e-01, -1.1996e-02,  8.8481e-03],
     [ 3.0038e-02, -4.8732e-02,  3.4291e-02],
     [-1.6961e-01, -7.1146e-02,  7.7459e-03]],

    [[ 1.8211e-01, -1.9583e-01,  4.9657e-02],
     [-2.4954e-01, -2.0284e-01,  5.3006e-02],
     [-1.2249e-02, -1.3302e-01,  4.7245e-02],
     ...,
     [-2.9095e-01, -7.0126e-02, -3.6737e-03],
     [-1.8131e-01, -1.2229e-01,  4.1551e-02],
     [ 1.6276e-01, -1.1245e-01, -9.8416e-03]],

    ...,

    [[ 7.4978e-02,  2.9431e-02,  1.1438e-01],
     [-1.0976e-01,  1.2037e-02,  1.9131e-01],
     [ 6.5552e-02, -6.5006e-02, -4.3287e-01],
     ...,
     [ 3.2897e-02, -6.6295e-02, -2.4680e-01],
     [-1.0976e-01, -2.2629e-02, -3.7765e-01],
     [-3.0945e-02, -6.6295e-02, -2.3848e-01]],

    [[ 3.0116e-02, -6.8771e-02,  8.2212e-02],
     [-5.2589e-02, -5.0030e-02, -2.5118e-01],
     [-2.9259e-01,  8.4208e-02,  2.5796e-03],
     ...,
     [ 2.2273e-01, -1.6826e-02, -2.8113e-02],
     [-3.3164e-01,  1.2110e-01, -8.0933e-04],
     [ 1.2961e-01, -1.1969e-02,  2.0946e-02]],

    [[-3.2086e-01, -8.7682e-03, -1.2897e-01],
     [-2.9544e-01, -1.1794e-01, -1.8177e-01],
     [ 6.8724e-02, -8.6465e-02, -1.3886e-01],
     ...,
     [-9.8108e-02, -5.4492e-02, -7.1824e-02],
     [-9.2724e-02,  9.5313e-02, -7.6063e-02],
     [-1.4927e-01,  6.3766e-02,  8.2568e-02]]], dtype=torch.float64), ('47133569866031669268271e4d570275', 'a097428376f298abd872dc56d048665c', 'e88c7403ff401716b7002bddf0942f8e', '4b10780b9e0f93f1d32761b337f8b72a', '27e65f34c3b8dd7f490ad276cd2af3a4', '25656d25d2c1e4f1d92ba773197b51', '30a525c7bd5ee80192b396ed960b67ad', '41c5a45c63f07f46c1c74fb098c415cf', 'c8f5f746daa5bd96b34ff70ac6c9e4d5', '3f1e897f2da10d808e52cc55aebae3ed', '43deffcae6d595f3fcb8d8c6d4df8143', '224ccf9ba2b786d953353c404519f02f', '23780fffcd205ae9f1ce854e012143bd', 'aa765d04e997e36a1742918a871fc8cf', '5b0ca203bc4021a2cf9ca735ff10053c', 'bd89eb4a7407f07e54d8afaf6caac97c', 'f8a6f60ee9926c01e7822b3160005e08', '5b1c430ced749ac3897e805df74453bf', 'c8631f63ec5899a4a84a884e8267301c', '7121296a75c725aee8f8c11a24c52ebb', '59fd3d1409c0ee2e47bc3701b998a7d5', 'b8ed32beb17c3cacafd477f714c68df9', '27a90972dfe64be5c3bd24f986301745', '89b66c5a15e9c00b9b43c20267c98bff', '2f87e4958b3c1d80b5da5256e41fa569', '388ea3f8ba27da8b777b6246417c94ff', 'f27a1f3db59556cba0ab1d82ef09f78f', 'b977915b93e87cbdd724c69102d5ef2', 'da3a71168ea830dcc82d9accadcc9c9e', '35665606f965e5b77db3006b81b54c0a', '270ec239221938991735ea0e092a805a', '5b7b8b094a52794675543092060e57fe', '4dc7fe6e98c4db21d79b19c7c4f0e293', 'caeabb766b3b9c67d3c1dc91e223304c', '8f85c2195890ccf671f0940f5ed452dc', 'b10efcf01493c922e7e684d25d4dcaf0', 'a4fd0a514cabe8c34fb315ce917a9ec2', '608af07bd357d605f155d75bbf62b80', 'c86cfe147872280463626070a93463cf', 'ab350e81ff71034434895070e6a9b93', 'aad5c7256a7c6ba92a4d67a8ec314d2a', '12cae0fa5180fce64b7366b9d17acf07', 'd6f81af7b34e8da814038d588fd1342f', 'a465210c23b0136d7afee304cce81d6f', '124ef426dfa0aa38ff6069724068a578', 'b00d6677641be37dbeedb4c8fd29e2d1', '169d73f18f7b17bb4a6ecce2eeb45768', '98bdce81ac602c76becf71e2e014ff6f', '7d097f4b38f0a8a65b6c7da997b0e5e3', '3cdabe258ed67a144da5feafe6f1c8fc', 'ec01e8b79f2d07df784a45ea6efa1d77', '3f79bfdf49c2b654c397356311cbeea4', '2d3c98d5d85f22a127babbd370e736b', '263eeac4bcfca21285f7a3de54751f1b', 'df25be12ae47d2517ef7776b3bf5815c', '3aba6ceca44f747b29a72cc7a32af9e5', '2444551d00693a0fab610b0c94236463', '425ff664205d2a7f5c0be177939e290', 'a7f5b96f138649c6bc30e923e47d8bd4', '298dcf7bd982cf0712de5317fe5b354f', 'de063371e5ef119cfcb8d8c6d4df8143', 'a996982326ffe668593ebeeedbff73b', '854c2f430e7aa00f4d210d9468aedaf2', '4cabd6d81c0a9e8c6436916a86a90ed7')]

`

ruiqiyan commented 1 year ago

您提供的预训练模型与yaml文件里的num_points: 2048并不相符。应该改为num_points: 16384

但是当我要生成点云结果把 save_vis 改为True时又会发生超出索引的报错

WangJun-ZJUT commented 1 year ago

您好,源码中生成点云的数量是根据yaml文件中的dataset自动变化的,与num_points参数无关。详见models/PointAttN.py