Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v6.2 is not torch.jit.trace-able #9341

Closed
1 of 2 tasks
iann838 opened this issue Sep 9, 2022 · 20 comments · Fixed by #9363
Closed
1 of 2 tasks

v6.2 is not torch.jit.trace-able #9341

iann838 opened this issue Sep 9, 2022 · 20 comments · Fixed by #9363
Labels
bug Something isn't working

Comments

@iann838
Copy link

iann838 commented Sep 9, 2022

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

Export

Bug

RuntimeError: Tracer cannot infer type of [tensor([[[3.90108e+00, 3.51982e+00, 7.49972e+00,  ..., 1.34236e-03, 5.71100e-04, 1.51904e-03],
         [1.25577e+01, 3.85056e+00, 2.50134e+01,  ..., 1.37933e-03, 7.87575e-04, 1.58038e-03],
         [1.82203e+01, 4.08799e+00, 3.27685e+01,  ..., 1.27277e-03, 7.89232e-04, 1.74723e-03],
         ...,
         [5.65528e+02, 6.05166e+02, 1.40831e+02,  ..., 2.28442e-03, 9.74671e-04, 1.18459e-03],
         [5.87936e+02, 6.05690e+02, 1.09919e+02,  ..., 2.31788e-03, 1.03343e-03, 1.28364e-03],
         [6.16071e+02, 6.17577e+02, 1.13814e+02,  ..., 2.21484e-03, 1.17585e-03, 1.36759e-03]]], device='cuda:0'), [tensor([[[[[-2.47311e-02, -1.20189e-01, -2.69603e-01,  ..., -6.61199e+00, -7.46738e+00, -6.48816e+00],
           [ 1.39640e-01, -3.73633e-02,  1.32964e+00,  ..., -6.58478e+00, -7.14576e+00, -6.44851e+00],
           [-4.52488e-01,  2.19985e-02,  2.25527e+00,  ..., -6.66529e+00, -7.14366e+00, -6.34798e+00],
           ...,
           [ 4.97860e-01, -1.42864e-02,  2.22957e+00,  ..., -6.71178e+00, -7.28462e+00, -6.53419e+00],
           [ 1.67795e-02, -1.44263e-02,  1.45703e+00,  ..., -6.58977e+00, -7.30584e+00, -6.58872e+00],
           [-6.61154e-02, -4.77693e-02,  1.36111e-01,  ..., -6.81560e+00, -7.49455e+00, -6.53362e+00]],

          [[ 3.46468e-02, -5.54281e-01, -2.06665e-01,  ..., -6.47864e+00, -6.99753e+00, -6.32274e+00],
           [ 2.24385e-01, -4.09977e-01,  1.40769e+00,  ..., -6.18504e+00, -6.55474e+00, -6.21109e+00],
           [-4.81755e-01, -2.84464e-01,  2.43764e+00,  ..., -6.26261e+00, -6.62054e+00, -6.26686e+00],
           ...,
           [ 5.49245e-01, -2.01014e-01,  2.34045e+00,  ..., -6.32678e+00, -6.75578e+00, -6.46146e+00],
           [-2.24361e-01, -2.22542e-01,  1.53432e+00,  ..., -6.25265e+00, -6.71997e+00, -6.43244e+00],
           [-1.25764e-01, -2.26024e-01,  1.52868e-01,  ..., -6.66342e+00, -7.05198e+00, -6.43002e+00]],

          [[ 4.77280e-02, -2.54394e-01, -1.49376e-01,  ..., -6.49147e+00, -6.93268e+00, -6.08526e+00],
           [ 5.40630e-02, -3.99160e-01,  1.30148e+00,  ..., -6.20859e+00, -6.52936e+00, -6.07076e+00],
           [-5.46465e-01, -3.63976e-01,  2.32209e+00,  ..., -6.35637e+00, -6.41372e+00, -5.82755e+00],
           ...,
           [ 5.97531e-01, -2.40077e-01,  2.23863e+00,  ..., -6.34066e+00, -6.49560e+00, -5.93900e+00],
           [-1.80851e-01, -4.15916e-01,  1.44382e+00,  ..., -6.18272e+00, -6.64966e+00, -6.23274e+00],
           [-1.77065e-01, -4.48482e-01,  1.31150e-01,  ..., -6.60402e+00, -6.93823e+00, -6.09752e+00]],

          ...,

          [[ 4.90179e-02,  1.11614e-01, -1.68648e-01,  ..., -6.62197e+00, -7.44169e+00, -6.62425e+00],
           [-6.03199e-02,  2.03530e-01,  1.21362e+00,  ..., -6.28422e+00, -7.05678e+00, -6.46348e+00],
           [-5.33094e-01,  2.04293e-01,  2.19861e+00,  ..., -6.46888e+00, -7.21079e+00, -6.48620e+00],
           ...,
           [ 3.36507e-01,  1.20573e-01,  2.21371e+00,  ..., -6.41392e+00, -7.19209e+00, -6.42839e+00],
           [-3.67394e-02,  1.55369e-01,  1.36192e+00,  ..., -6.24387e+00, -7.09311e+00, -6.45117e+00],
           [-2.16063e-01, -3.91476e-02,  1.32146e-01,  ..., -6.63127e+00, -7.26134e+00, -6.31423e+00]],

          [[-6.08644e-02,  1.50407e-01, -1.86085e-01,  ..., -6.67159e+00, -7.48115e+00, -6.72478e+00],
           [-9.29725e-03,  2.29891e-01,  1.28717e+00,  ..., -6.34584e+00, -7.08282e+00, -6.48086e+00],
           [-4.73167e-01,  1.61046e-01,  2.07065e+00,  ..., -6.67102e+00, -7.32073e+00, -6.47930e+00],
           ...,
           [ 3.77907e-01,  1.58237e-01,  2.01086e+00,  ..., -6.68624e+00, -7.34654e+00, -6.44690e+00],
           [-3.97577e-02,  2.96916e-01,  1.36264e+00,  ..., -6.52740e+00, -7.18983e+00, -6.44917e+00],
           [-2.34954e-01,  1.83385e-01,  1.68534e-01,  ..., -6.80836e+00, -7.35229e+00, -6.44531e+00]],

          [[ 3.84562e-02, -2.22562e-01, -2.11717e-01,  ..., -6.78912e+00, -7.62159e+00, -6.75947e+00],
           [-1.33721e-01, -2.58688e-01,  9.87313e-01,  ..., -6.52777e+00, -7.11568e+00, -6.47199e+00],
           [-3.00205e-01, -2.34682e-01,  1.48008e+00,  ..., -6.78179e+00, -7.30683e+00, -6.42683e+00],
           ...,
           [ 1.11894e-01, -3.45938e-01,  1.56257e+00,  ..., -6.78197e+00, -7.31398e+00, -6.41252e+00],
           [ 1.86455e-01, -3.15948e-01,  1.12785e+00,  ..., -6.71618e+00, -7.26681e+00, -6.48088e+00],
           [-2.06541e-01, -2.40219e-01,  6.07349e-02,  ..., -7.03842e+00, -7.51807e+00, -6.56016e+00]]],


         [[[ 1.91967e-01, -1.73754e-01, -3.47340e-01,  ..., -6.21661e+00, -7.34805e+00, -6.36990e+00],
           [ 3.67719e-01,  2.36624e-02,  6.19392e-01,  ..., -6.24416e+00, -6.98809e+00, -6.38946e+00],
           [-3.07451e-02,  1.07420e-01,  1.64948e+00,  ..., -6.29253e+00, -6.98034e+00, -6.41912e+00],
           ...,
           [ 1.90642e-01,  8.07729e-02,  1.50975e+00,  ..., -6.32870e+00, -7.13179e+00, -6.57559e+00],
           [-1.36046e-01,  7.13567e-02,  6.49270e-01,  ..., -6.22917e+00, -7.16367e+00, -6.52016e+00],
           [-4.23631e-01, -1.32467e-02,  1.81635e-01,  ..., -6.39787e+00, -7.37875e+00, -6.44922e+00]],

          [[ 1.95628e-01, -4.82413e-01, -5.17016e-01,  ..., -6.18210e+00, -6.91742e+00, -6.23441e+00],
           [ 3.56851e-01, -4.38508e-01,  6.06966e-01,  ..., -5.94315e+00, -6.46752e+00, -6.22426e+00],
           [ 6.30793e-03, -3.07447e-01,  1.43248e+00,  ..., -5.97510e+00, -6.51727e+00, -6.39855e+00],
           ...,
           [ 1.48801e-01, -2.07263e-01,  1.26984e+00,  ..., -6.04695e+00, -6.67767e+00, -6.57335e+00],
           [-3.63289e-01, -2.28078e-01,  6.41511e-01,  ..., -6.00475e+00, -6.64016e+00, -6.43212e+00],
           [-4.01015e-01, -2.47017e-01, -1.60080e-01,  ..., -6.39764e+00, -7.04039e+00, -6.38269e+00]],

          [[ 1.80563e-01, -2.30596e-01, -4.81097e-01,  ..., -6.16476e+00, -6.87054e+00, -6.02726e+00],
           [ 1.88084e-01, -3.70605e-01,  5.62126e-01,  ..., -5.95154e+00, -6.44581e+00, -6.10782e+00],
           [-1.73092e-01, -3.15865e-01,  1.33849e+00,  ..., -6.06331e+00, -6.27047e+00, -5.94738e+00],
           ...,
           [ 2.58488e-01, -1.88293e-01,  1.17623e+00,  ..., -6.04928e+00, -6.34898e+00, -6.03497e+00],
           [-2.99941e-01, -3.85608e-01,  5.98687e-01,  ..., -5.91531e+00, -6.55838e+00, -6.25741e+00],
           [-4.03979e-01, -4.86852e-01, -1.85711e-01,  ..., -6.32116e+00, -6.93678e+00, -6.08690e+00]],

          ...,

          [[ 1.99274e-01,  1.29619e-02, -4.82355e-01,  ..., -6.39717e+00, -7.48569e+00, -6.62409e+00],
           [ 9.99950e-02,  2.21975e-03,  5.41968e-01,  ..., -6.12766e+00, -7.12435e+00, -6.59628e+00],
           [-1.65795e-01, -2.15790e-02,  1.40890e+00,  ..., -6.26984e+00, -7.26593e+00, -6.71048e+00],
           ...,
           [ 8.57415e-02, -1.14354e-01,  1.33330e+00,  ..., -6.21079e+00, -7.21086e+00, -6.60092e+00],
           [-1.63772e-01, -3.88068e-03,  5.69975e-01,  ..., -6.06160e+00, -7.12303e+00, -6.55945e+00],
           [-4.20936e-01, -1.41395e-01, -2.04161e-01,  ..., -6.40950e+00, -7.31334e+00, -6.33885e+00]],

          [[ 9.38032e-02, -3.16520e-03, -5.18489e-01,  ..., -6.43199e+00, -7.49575e+00, -6.69553e+00],
           [ 1.00445e-01,  3.63420e-02,  5.44173e-01,  ..., -6.17453e+00, -7.13572e+00, -6.58013e+00],
           [-2.05845e-01, -7.81574e-02,  1.33515e+00,  ..., -6.43365e+00, -7.34877e+00, -6.64263e+00],
           ...,
           [ 1.02058e-01, -1.11940e-01,  1.30761e+00,  ..., -6.43698e+00, -7.35946e+00, -6.58825e+00],
           [-1.67804e-01,  1.30607e-01,  5.60734e-01,  ..., -6.32451e+00, -7.19690e+00, -6.51509e+00],
           [-4.62427e-01, -1.79164e-02, -1.91379e-01,  ..., -6.57439e+00, -7.36576e+00, -6.42756e+00]],

          [[ 2.54388e-01, -3.54100e-01, -2.77431e-01,  ..., -6.42439e+00, -7.59221e+00, -6.69876e+00],
           [-6.58193e-02, -4.46462e-01,  4.33948e-01,  ..., -6.25939e+00, -7.12031e+00, -6.50155e+00],
           [-1.32950e-01, -4.46467e-01,  1.04495e+00,  ..., -6.46524e+00, -7.28676e+00, -6.49123e+00],
           ...,
           [ 8.95296e-02, -5.69749e-01,  1.08714e+00,  ..., -6.46475e+00, -7.28373e+00, -6.45241e+00],
           [ 7.78694e-02, -4.97744e-01,  4.93460e-01,  ..., -6.42325e+00, -7.25114e+00, -6.47221e+00],
           [-4.47631e-01, -5.13316e-01, -8.69743e-02,  ..., -6.71087e+00, -7.51124e+00, -6.52952e+00]]],


         [[[ 3.16613e-01, -9.91557e-02, -7.47213e-01,  ..., -6.21231e+00, -7.20127e+00, -6.54976e+00],
           [ 3.91644e-01,  9.64648e-02, -2.23677e-01,  ..., -6.30182e+00, -6.91144e+00, -6.37676e+00],
           [ 7.64130e-02,  1.61943e-01,  2.82090e-01,  ..., -6.31754e+00, -6.90924e+00, -6.42298e+00],
           ...,
           [ 1.73327e-01,  1.39887e-01,  2.26020e-01,  ..., -6.33635e+00, -7.06538e+00, -6.59921e+00],
           [-1.70978e-01,  1.45433e-01, -2.09930e-01,  ..., -6.24580e+00, -7.08721e+00, -6.51593e+00],
           [-5.77524e-01,  7.20539e-02, -4.84204e-01,  ..., -6.39193e+00, -7.22920e+00, -6.57166e+00]],

          [[ 3.57887e-01, -3.85923e-01, -8.53880e-01,  ..., -6.19235e+00, -6.74283e+00, -6.39696e+00],
           [ 3.80995e-01, -3.32876e-01, -1.98670e-01,  ..., -6.01069e+00, -6.35811e+00, -6.19268e+00],
           [ 1.31486e-01, -2.33366e-01,  2.60738e-01,  ..., -6.02579e+00, -6.41002e+00, -6.36929e+00],
           ...,
           [ 1.18206e-01, -1.17774e-01,  1.86560e-01,  ..., -6.08025e+00, -6.56536e+00, -6.57359e+00],
           [-3.95296e-01, -1.34147e-01, -1.72576e-01,  ..., -6.03856e+00, -6.53116e+00, -6.40057e+00],
           [-5.28273e-01, -1.45842e-01, -6.66608e-01,  ..., -6.43252e+00, -6.86946e+00, -6.45594e+00]],

          [[ 3.64694e-01, -1.22264e-01, -8.23197e-01,  ..., -6.15457e+00, -6.67390e+00, -6.17443e+00],
           [ 2.37408e-01, -2.35674e-01, -2.01531e-01,  ..., -5.99601e+00, -6.29665e+00, -6.08643e+00],
           [-2.49452e-02, -2.23169e-01,  2.25740e-01,  ..., -6.08590e+00, -6.10572e+00, -5.90512e+00],
           ...,
           [ 2.49223e-01, -1.00262e-01,  1.48326e-01,  ..., -6.04129e+00, -6.17767e+00, -6.02047e+00],
           [-3.08803e-01, -2.72458e-01, -1.78955e-01,  ..., -5.92416e+00, -6.41268e+00, -6.23825e+00],
           [-4.84021e-01, -3.58818e-01, -6.52056e-01,  ..., -6.33583e+00, -6.74787e+00, -6.17850e+00]],

          ...,

          [[ 3.75264e-01,  9.75346e-02, -8.30717e-01,  ..., -6.42954e+00, -7.34167e+00, -6.78571e+00],
           [ 1.18174e-01,  1.11422e-01, -2.31017e-01,  ..., -6.21976e+00, -7.04415e+00, -6.60815e+00],
           [-5.28543e-02,  5.35164e-02,  2.40589e-01,  ..., -6.33592e+00, -7.17213e+00, -6.71465e+00],
           ...,
           [ 8.62069e-02, -4.45599e-02,  1.96328e-01,  ..., -6.24954e+00, -7.10106e+00, -6.61346e+00],
           [-1.79860e-01,  8.83098e-02, -2.25452e-01,  ..., -6.11516e+00, -7.02956e+00, -6.56588e+00],
           [-5.19691e-01, -2.72137e-02, -6.71657e-01,  ..., -6.44729e+00, -7.15105e+00, -6.45300e+00]],

          [[ 2.72735e-01,  1.47290e-02, -8.58224e-01,  ..., -6.45374e+00, -7.33624e+00, -6.81380e+00],
           [ 1.30481e-01,  7.25979e-02, -2.37328e-01,  ..., -6.25598e+00, -7.04032e+00, -6.54813e+00],
           [-9.25328e-02, -6.37552e-02,  2.00663e-01,  ..., -6.48308e+00, -7.23777e+00, -6.61936e+00],
           ...,
           [ 1.18621e-01, -1.05429e-01,  1.70454e-01,  ..., -6.46217e+00, -7.22583e+00, -6.57607e+00],
           [-1.73392e-01,  1.54606e-01, -2.32664e-01,  ..., -6.36127e+00, -7.08508e+00, -6.48318e+00],
           [-5.69854e-01,  2.35152e-02, -6.85180e-01,  ..., -6.60397e+00, -7.17776e+00, -6.47646e+00]],

          [[ 3.85604e-01, -2.56620e-01, -5.55203e-01,  ..., -6.41808e+00, -7.48005e+00, -6.86451e+00],
           [-5.97579e-02, -3.09582e-01, -2.64957e-01,  ..., -6.30329e+00, -7.07811e+00, -6.54039e+00],
           [-6.86648e-02, -3.30094e-01,  1.54914e-01,  ..., -6.48039e+00, -7.22055e+00, -6.51116e+00],
           ...,
           [ 1.08595e-01, -4.50213e-01,  1.99687e-01,  ..., -6.46922e+00, -7.20806e+00, -6.47179e+00],
           [ 8.80348e-02, -3.57779e-01, -2.58907e-01,  ..., -6.44475e+00, -7.19969e+00, -6.49293e+00],
           [-5.20544e-01, -3.96280e-01, -5.67742e-01,  ..., -6.71660e+00, -7.37856e+00, -6.64547e+00]]]]], device='cuda:0'), tensor([[[[[-4.02233e-01,  8.85910e-02, -3.12930e-01,  ..., -5.97532e+00, -6.69853e+00, -6.03362e+00],
           [ 3.79193e-01,  4.63138e-01,  6.45912e-01,  ..., -5.87537e+00, -6.51115e+00, -6.06814e+00],
           [-1.14959e-01,  4.88814e-01,  1.40582e+00,  ..., -5.90294e+00, -6.63775e+00, -6.31539e+00],
           ...,
           [ 1.21907e-01,  4.79893e-01,  1.37364e+00,  ..., -5.81034e+00, -6.61193e+00, -6.30866e+00],
           [-2.18159e-02,  4.58684e-01,  5.63409e-01,  ..., -5.78087e+00, -6.52257e+00, -6.28619e+00],
           [-1.92381e-01,  1.25252e-01, -1.41671e-01,  ..., -5.88357e+00, -6.70961e+00, -6.28466e+00]],

          [[ 2.29004e-01, -9.41223e-02, -2.34635e-01,  ..., -6.01481e+00, -6.61771e+00, -6.22829e+00],
           [ 4.37686e-01,  4.34768e-02,  7.36558e-01,  ..., -5.85908e+00, -6.30652e+00, -6.32421e+00],
           [-9.51615e-02,  1.34221e-01,  1.32276e+00,  ..., -5.77427e+00, -6.32944e+00, -6.35544e+00],
           ...,
           [ 1.48079e-01,  1.91451e-01,  1.37135e+00,  ..., -5.72918e+00, -6.39159e+00, -6.44223e+00],
           [-7.76016e-02,  1.47711e-01,  6.30252e-01,  ..., -5.72207e+00, -6.18598e+00, -6.24216e+00],
           [-5.85347e-01, -8.75086e-02, -6.90764e-02,  ..., -5.96457e+00, -6.67881e+00, -6.51695e+00]],

          [[ 1.62357e-01, -2.80445e-02, -2.29998e-01,  ..., -5.97805e+00, -6.63759e+00, -6.26424e+00],
           [ 4.33504e-01, -1.64126e-02,  7.51407e-01,  ..., -5.86685e+00, -6.37806e+00, -6.37068e+00],
           [-8.69176e-02,  2.61895e-02,  1.33339e+00,  ..., -5.76257e+00, -6.42435e+00, -6.36429e+00],
           ...,
           [ 1.47311e-01,  8.08412e-02,  1.38491e+00,  ..., -5.71497e+00, -6.46612e+00, -6.42524e+00],
           [-1.68747e-01, -7.48632e-02,  6.85132e-01,  ..., -5.76239e+00, -6.35419e+00, -6.34871e+00],
           [-5.10864e-01, -7.62237e-02, -8.38755e-02,  ..., -5.97262e+00, -6.77543e+00, -6.56460e+00]],

          ...,

          [[ 5.50661e-01,  2.29785e-01, -1.79356e-01,  ..., -5.96912e+00, -6.99807e+00, -6.49706e+00],
           [ 2.96846e-01,  1.43304e-01,  6.79982e-01,  ..., -5.92266e+00, -6.99398e+00, -6.83364e+00],
           [-2.33223e-01,  4.19223e-02,  1.27413e+00,  ..., -5.88811e+00, -7.02233e+00, -6.89891e+00],
           ...,
           [ 1.81069e-01, -1.95748e-02,  1.35339e+00,  ..., -5.80038e+00, -6.91769e+00, -6.72332e+00],
           [-1.93861e-01,  3.41331e-02,  6.57123e-01,  ..., -5.72509e+00, -6.79532e+00, -6.53952e+00],
           [-6.81446e-01,  8.10727e-02, -6.72479e-02,  ..., -5.95038e+00, -7.00868e+00, -6.61595e+00]],

          [[ 4.56186e-01,  2.69662e-01, -1.74315e-01,  ..., -5.98762e+00, -7.00701e+00, -6.55076e+00],
           [ 3.73454e-01,  1.27653e-01,  6.92195e-01,  ..., -5.87807e+00, -6.93694e+00, -6.79463e+00],
           [-1.70675e-01,  5.41850e-02,  1.28947e+00,  ..., -5.85833e+00, -6.94015e+00, -6.78733e+00],
           ...,
           [ 1.28148e-01,  7.14230e-02,  1.36913e+00,  ..., -5.79018e+00, -6.88690e+00, -6.61155e+00],
           [-2.75865e-01, -1.01172e-02,  6.99338e-01,  ..., -5.71416e+00, -6.79691e+00, -6.50679e+00],
           [-8.21710e-01,  1.04018e-01, -5.49680e-03,  ..., -5.95346e+00, -7.00339e+00, -6.63848e+00]],

          [[-4.51919e-01, -5.21167e-01, -3.41044e-01,  ..., -6.18197e+00, -7.12840e+00, -6.60265e+00],
           [ 1.37960e-01, -1.02760e+00,  5.46337e-01,  ..., -6.15408e+00, -7.07862e+00, -6.75033e+00],
           [-6.59410e-02, -1.06319e+00,  1.13729e+00,  ..., -6.16725e+00, -7.07450e+00, -6.71898e+00],
           ...,
           [ 1.87327e-01, -1.15039e+00,  1.23894e+00,  ..., -6.14600e+00, -7.09711e+00, -6.69925e+00],
           [ 1.37266e-01, -1.14007e+00,  5.15725e-01,  ..., -6.15677e+00, -7.02969e+00, -6.65968e+00],
           [-3.23001e-01, -7.68967e-01, -1.60617e-01,  ..., -6.20798e+00, -7.06216e+00, -6.52247e+00]]],


         [[[-1.24135e-02,  7.31219e-02, -6.89571e-01,  ..., -5.91350e+00, -6.68465e+00, -6.14478e+00],
           [ 4.22587e-01,  4.24957e-01, -1.88166e-01,  ..., -5.89035e+00, -6.56129e+00, -6.11904e+00],
           [-1.45034e-02,  4.55938e-01,  2.29183e-01,  ..., -5.93533e+00, -6.71562e+00, -6.36562e+00],
           ...,
           [ 1.06953e-01,  4.58762e-01,  2.06580e-01,  ..., -5.83750e+00, -6.68799e+00, -6.37466e+00],
           [-9.38642e-03,  4.27428e-01, -2.65414e-01,  ..., -5.79217e+00, -6.57794e+00, -6.33959e+00],
           [-3.97368e-01,  1.03886e-01, -6.70836e-01,  ..., -5.85069e+00, -6.71854e+00, -6.35826e+00]],

          [[ 6.33248e-01, -8.77446e-02, -6.73521e-01,  ..., -5.96634e+00, -6.60343e+00, -6.37883e+00],
           [ 4.53071e-01,  5.62342e-02, -1.29829e-01,  ..., -5.87471e+00, -6.34557e+00, -6.41197e+00],
           [-4.66807e-02,  1.57220e-01,  2.15498e-01,  ..., -5.80176e+00, -6.38838e+00, -6.45180e+00],
           ...,
           [ 1.21933e-01,  2.07294e-01,  2.13780e-01,  ..., -5.75408e+00, -6.45208e+00, -6.55824e+00],
           [-7.09838e-02,  1.55865e-01, -2.15941e-01,  ..., -5.73404e+00, -6.23150e+00, -6.34221e+00],
           [-8.66852e-01, -7.60251e-02, -6.37383e-01,  ..., -5.94006e+00, -6.68762e+00, -6.64023e+00]],

          [[ 5.24593e-01, -3.29780e-02, -6.73577e-01,  ..., -5.91156e+00, -6.60481e+00, -6.42008e+00],
           [ 4.32036e-01, -3.25845e-02, -1.15895e-01,  ..., -5.86737e+00, -6.39917e+00, -6.47083e+00],
           [-5.61765e-02,  2.02369e-02,  2.20541e-01,  ..., -5.78035e+00, -6.45947e+00, -6.46902e+00],
           ...,
           [ 1.08421e-01,  7.14010e-02,  2.16104e-01,  ..., -5.73092e+00, -6.50178e+00, -6.54584e+00],
           [-1.61951e-01, -9.16583e-02, -1.75080e-01,  ..., -5.77683e+00, -6.37805e+00, -6.44929e+00],
           [-7.89475e-01, -9.01383e-02, -6.23679e-01,  ..., -5.93215e+00, -6.76655e+00, -6.70150e+00]],

          ...,

          [[ 9.66324e-01,  2.03867e-01, -6.32609e-01,  ..., -5.92451e+00, -6.97300e+00, -6.66553e+00],
           [ 3.41905e-01,  1.01563e-01, -1.48067e-01,  ..., -5.94136e+00, -7.04287e+00, -6.96819e+00],
           [-1.73438e-01,  1.23663e-02,  1.95228e-01,  ..., -5.90853e+00, -7.09066e+00, -7.04256e+00],
           ...,
           [ 1.62095e-01, -6.13819e-02,  2.10905e-01,  ..., -5.82566e+00, -6.96748e+00, -6.85377e+00],
           [-1.85200e-01, -1.31998e-02, -1.82664e-01,  ..., -5.75493e+00, -6.82479e+00, -6.65236e+00],
           [-9.78156e-01,  4.41197e-02, -6.08700e-01,  ..., -5.93367e+00, -6.99526e+00, -6.75235e+00]],

          [[ 9.26209e-01,  2.41660e-01, -5.98332e-01,  ..., -5.95177e+00, -6.99543e+00, -6.70217e+00],
           [ 4.07490e-01,  9.15936e-02, -1.33786e-01,  ..., -5.90276e+00, -6.97818e+00, -6.89148e+00],
           [-1.29615e-01,  2.31660e-02,  1.96615e-01,  ..., -5.88315e+00, -6.99970e+00, -6.90003e+00],
           ...,
           [ 7.26327e-02,  3.01868e-02,  2.23367e-01,  ..., -5.82597e+00, -6.93499e+00, -6.71563e+00],
           [-2.82456e-01, -5.20516e-02, -1.52109e-01,  ..., -5.75380e+00, -6.81586e+00, -6.58326e+00],
           [-1.13625e+00,  6.50631e-02, -5.83431e-01,  ..., -5.95010e+00, -6.99231e+00, -6.74252e+00]],

          [[-2.43875e-02, -4.89440e-01, -5.34673e-01,  ..., -6.12795e+00, -7.11237e+00, -6.73323e+00],
           [ 1.06990e-01, -1.00199e+00, -2.26079e-01,  ..., -6.16510e+00, -7.11234e+00, -6.81519e+00],
           [-4.74793e-02, -1.03802e+00,  1.16704e-01,  ..., -6.18280e+00, -7.12291e+00, -6.79159e+00],
           ...,
           [ 1.52136e-01, -1.13439e+00,  1.48818e-01,  ..., -6.17097e+00, -7.13842e+00, -6.76159e+00],
           [ 1.58462e-01, -1.12305e+00, -2.88783e-01,  ..., -6.17958e+00, -7.05657e+00, -6.71476e+00],
           [-5.81375e-01, -7.41450e-01, -6.27655e-01,  ..., -6.18074e+00, -7.04837e+00, -6.61157e+00]]],


         [[[-9.18286e-02,  3.41598e-01, -4.83229e-01,  ..., -5.78949e+00, -6.58586e+00, -6.01834e+00],
           [ 4.60522e-01,  1.27887e+00, -9.12100e-02,  ..., -5.77601e+00, -6.41761e+00, -6.00964e+00],
           [ 1.28274e-02,  1.30362e+00,  3.01988e-01,  ..., -5.84476e+00, -6.57577e+00, -6.25902e+00],
           ...,
           [ 8.47224e-02,  1.24850e+00,  2.84769e-01,  ..., -5.72407e+00, -6.57687e+00, -6.26225e+00],
           [-7.57092e-02,  1.16396e+00, -1.95687e-01,  ..., -5.67423e+00, -6.45290e+00, -6.20112e+00],
           [-3.96059e-01,  4.12118e-01, -5.76047e-01,  ..., -5.69492e+00, -6.64023e+00, -6.24832e+00]],

          [[ 6.34471e-01,  2.43092e-02, -6.38709e-01,  ..., -5.92577e+00, -6.61581e+00, -6.23647e+00],
           [ 5.16049e-01,  3.15232e-01, -8.94024e-02,  ..., -5.86742e+00, -6.34736e+00, -6.26857e+00],
           [-1.10250e-02,  3.14319e-01,  2.64390e-01,  ..., -5.80753e+00, -6.39369e+00, -6.32460e+00],
           ...,
           [ 1.23893e-01,  3.80076e-01,  2.67911e-01,  ..., -5.74358e+00, -6.48811e+00, -6.42992e+00],
           [-1.03645e-01,  3.16795e-01, -1.60345e-01,  ..., -5.71882e+00, -6.23732e+00, -6.17774e+00],
           [-8.89056e-01,  6.69175e-02, -5.90267e-01,  ..., -5.86443e+00, -6.71969e+00, -6.50415e+00]],

          [[ 5.11950e-01, -1.72382e-02, -6.46818e-01,  ..., -5.88936e+00, -6.64532e+00, -6.26756e+00],
           [ 4.89313e-01,  4.25505e-02, -8.45456e-02,  ..., -5.88811e+00, -6.44482e+00, -6.30900e+00],
           [-2.23161e-02,  8.78023e-02,  2.63237e-01,  ..., -5.79768e+00, -6.50219e+00, -6.33672e+00],
           ...,
           [ 1.17071e-01,  1.66147e-01,  2.59732e-01,  ..., -5.72866e+00, -6.57146e+00, -6.41600e+00],
           [-1.88187e-01, -1.96404e-02, -1.31422e-01,  ..., -5.78903e+00, -6.41670e+00, -6.28273e+00],
           [-8.18001e-01, -5.87514e-02, -5.82248e-01,  ..., -5.86664e+00, -6.82256e+00, -6.55893e+00]],

          ...,

          [[ 9.72402e-01,  1.59801e-01, -6.10421e-01,  ..., -5.92020e+00, -6.99589e+00, -6.56262e+00],
           [ 3.80536e-01,  1.20754e-01, -1.20411e-01,  ..., -5.96922e+00, -7.07250e+00, -6.87998e+00],
           [-1.46618e-01,  3.80048e-03,  2.30947e-01,  ..., -5.93775e+00, -7.12651e+00, -6.97335e+00],
           ...,
           [ 1.56119e-01, -5.52344e-02,  2.52180e-01,  ..., -5.86026e+00, -7.00465e+00, -6.78116e+00],
           [-2.17132e-01,  1.30024e-02, -1.40385e-01,  ..., -5.78954e+00, -6.83632e+00, -6.53263e+00],
           [-1.00543e+00,  4.46316e-02, -5.75114e-01,  ..., -5.89874e+00, -7.02374e+00, -6.62857e+00]],

          [[ 9.14439e-01, -4.02896e-02, -5.76596e-01,  ..., -5.91120e+00, -6.97536e+00, -6.59810e+00],
           [ 4.49329e-01, -1.42284e-01, -9.56671e-02,  ..., -5.88856e+00, -6.95557e+00, -6.78470e+00],
           [-9.67491e-02, -1.75794e-01,  2.43555e-01,  ..., -5.87053e+00, -6.99489e+00, -6.80914e+00],
           ...,
           [ 7.38623e-02, -1.60301e-01,  2.71887e-01,  ..., -5.81599e+00, -6.92293e+00, -6.62462e+00],
           [-3.14202e-01, -2.05732e-01, -1.06109e-01,  ..., -5.75215e+00, -6.77716e+00, -6.44463e+00],
           [-1.16353e+00, -1.28178e-01, -5.43834e-01,  ..., -5.88270e+00, -6.97449e+00, -6.61432e+00]],

          [[-3.82594e-02, -9.15722e-01, -4.26145e-01,  ..., -6.03146e+00, -7.04339e+00, -6.62708e+00],
           [ 1.44361e-01, -1.41016e+00, -1.70109e-01,  ..., -6.06302e+00, -7.01140e+00, -6.68164e+00],
           [-1.88658e-02, -1.40894e+00,  1.77343e-01,  ..., -6.08211e+00, -7.04279e+00, -6.66794e+00],
           ...,
           [ 1.66059e-01, -1.50217e+00,  2.11462e-01,  ..., -6.07338e+00, -7.04886e+00, -6.63146e+00],
           [ 1.36394e-01, -1.50668e+00, -2.35019e-01,  ..., -6.07734e+00, -6.94301e+00, -6.56437e+00],
           [-5.72741e-01, -1.13810e+00, -5.26387e-01,  ..., -6.02529e+00, -7.00938e+00, -6.52312e+00]]]]], device='cuda:0'), tensor([[[[[ 9.49725e-01,  2.24121e-01, -4.32943e-01,  ..., -6.31462e+00, -7.01291e+00, -7.03585e+00],
           [-8.17880e-02,  5.84569e-01, -2.15279e-01,  ..., -5.83494e+00, -6.71985e+00, -6.96871e+00],
           [-3.68986e-01,  2.02804e-01,  1.84227e-01,  ..., -5.88499e+00, -6.83700e+00, -7.01339e+00],
           ...,
           [ 3.51426e-01,  1.77096e-01,  2.05701e-01,  ..., -5.99453e+00, -6.80613e+00, -6.98416e+00],
           [ 1.59018e-01,  4.18284e-01, -2.80360e-01,  ..., -5.88215e+00, -6.71597e+00, -6.98126e+00],
           [-9.12725e-01,  3.57186e-01, -5.33632e-01,  ..., -6.28282e+00, -6.93174e+00, -7.13928e+00]],

          [[ 1.08648e+00, -2.80723e-01, -4.72256e-01,  ..., -6.27287e+00, -7.02385e+00, -7.16648e+00],
           [-5.73388e-02, -2.89405e-01, -2.08289e-01,  ..., -5.99818e+00, -6.90283e+00, -7.17764e+00],
           [-3.07584e-01, -2.99773e-01,  2.26941e-01,  ..., -5.99709e+00, -7.00913e+00, -7.18615e+00],
           ...,
           [ 4.68535e-01, -1.61913e-01,  2.22058e-01,  ..., -6.17360e+00, -6.96137e+00, -7.08723e+00],
           [ 9.86087e-02, -1.58973e-01, -2.36670e-01,  ..., -6.07722e+00, -6.92105e+00, -7.06926e+00],
           [-1.11271e+00, -8.15403e-02, -5.63934e-01,  ..., -6.40928e+00, -7.06343e+00, -7.24816e+00]],

          [[ 1.02286e+00, -4.12146e-01, -4.26227e-01,  ..., -6.16740e+00, -7.12991e+00, -7.15108e+00],
           [ 2.91306e-01, -2.70800e-01, -9.75206e-02,  ..., -5.91438e+00, -7.02309e+00, -7.14225e+00],
           [-1.89020e-01, -3.17809e-02,  2.78194e-01,  ..., -5.95602e+00, -7.16658e+00, -7.21427e+00],
           ...,
           [ 3.95820e-01,  4.91877e-02,  2.55271e-01,  ..., -6.17298e+00, -7.09485e+00, -7.14411e+00],
           [-1.16867e-01, -1.54857e-01, -1.48981e-01,  ..., -6.02020e+00, -7.06202e+00, -7.06098e+00],
           [-1.17898e+00, -2.77518e-01, -4.78124e-01,  ..., -6.37135e+00, -7.17588e+00, -7.22781e+00]],

          ...,

          [[ 9.37903e-01,  5.36535e-01, -6.40657e-01,  ..., -6.31692e+00, -7.31931e+00, -7.26684e+00],
           [-3.14152e-01,  5.45830e-01, -2.78494e-01,  ..., -6.17929e+00, -7.28049e+00, -7.28262e+00],
           [-3.44249e-01,  2.38393e-01,  1.73456e-01,  ..., -6.39747e+00, -7.32170e+00, -7.26432e+00],
           ...,
           [ 6.15164e-01,  4.68640e-01,  1.83383e-01,  ..., -6.22838e+00, -7.16688e+00, -7.02621e+00],
           [ 4.23665e-01,  6.23680e-01, -3.24013e-01,  ..., -5.97610e+00, -7.19931e+00, -7.03126e+00],
           [-9.72868e-01,  4.56036e-01, -5.85525e-01,  ..., -6.43331e+00, -7.36632e+00, -7.31624e+00]],

          [[ 1.10912e+00,  4.67220e-01, -6.06139e-01,  ..., -6.20378e+00, -7.27478e+00, -7.22538e+00],
           [-2.24289e-01,  5.52392e-01, -2.50616e-01,  ..., -6.29860e+00, -7.33686e+00, -7.39175e+00],
           [-3.49062e-01,  4.04096e-01,  1.88337e-01,  ..., -6.32319e+00, -7.29975e+00, -7.32282e+00],
           ...,
           [ 5.85497e-01,  4.65997e-01,  1.85755e-01,  ..., -6.20217e+00, -7.17793e+00, -7.10994e+00],
           [ 3.26284e-01,  4.09691e-01, -2.94907e-01,  ..., -6.15628e+00, -7.21799e+00, -7.19212e+00],
           [-1.08894e+00,  4.52219e-01, -5.63724e-01,  ..., -6.44836e+00, -7.33568e+00, -7.40674e+00]],

          [[ 8.42262e-01, -4.37973e-01, -5.06089e-01,  ..., -6.55645e+00, -7.38609e+00, -7.39287e+00],
           [-1.10976e-01, -1.08222e+00, -1.97549e-01,  ..., -6.57907e+00, -7.43664e+00, -7.43918e+00],
           [-2.89328e-01, -7.89229e-01,  1.20160e-01,  ..., -6.59256e+00, -7.43445e+00, -7.45599e+00],
           ...,
           [ 4.44297e-01, -7.70325e-01,  1.67219e-01,  ..., -6.52136e+00, -7.37295e+00, -7.35975e+00],
           [ 2.02091e-01, -1.06151e+00, -2.55759e-01,  ..., -6.51957e+00, -7.35404e+00, -7.33559e+00],
           [-8.98407e-01, -9.89282e-01, -6.20665e-01,  ..., -6.61434e+00, -7.29823e+00, -7.33785e+00]]],


         [[[ 8.10681e-01,  5.11292e-01, -5.99286e-01,  ..., -6.20538e+00, -7.06624e+00, -7.00030e+00],
           [-5.55483e-02,  1.09814e+00, -4.77029e-01,  ..., -5.72126e+00, -6.80565e+00, -6.88020e+00],
           [-3.96634e-01,  7.98251e-01, -1.39200e-01,  ..., -5.79543e+00, -6.91798e+00, -6.99129e+00],
           ...,
           [ 3.93887e-01,  7.90463e-01, -1.26131e-01,  ..., -5.91625e+00, -6.90425e+00, -6.99187e+00],
           [ 1.96867e-01,  8.97503e-01, -5.12520e-01,  ..., -5.77776e+00, -6.82025e+00, -6.93691e+00],
           [-9.75085e-01,  5.34979e-01, -7.24623e-01,  ..., -6.17206e+00, -7.00006e+00, -7.08940e+00]],

          [[ 1.20857e+00, -1.06501e-01, -7.09167e-01,  ..., -6.17310e+00, -7.10282e+00, -7.07758e+00],
           [-1.63878e-02, -9.84540e-02, -4.75596e-01,  ..., -5.89790e+00, -7.03983e+00, -7.10507e+00],
           [-3.02250e-01, -5.57333e-03, -8.04419e-02,  ..., -5.91242e+00, -7.11677e+00, -7.16111e+00],
           ...,
           [ 5.07939e-01,  7.90678e-02, -1.01479e-01,  ..., -6.09571e+00, -7.07775e+00, -7.08580e+00],
           [ 1.43495e-01,  2.65175e-02, -4.97778e-01,  ..., -5.97970e+00, -7.04832e+00, -7.03289e+00],
           [-1.16113e+00,  7.97651e-02, -7.56075e-01,  ..., -6.30469e+00, -7.14245e+00, -7.17915e+00]],

          [[ 1.16842e+00, -4.20419e-01, -6.92898e-01,  ..., -6.08248e+00, -7.20771e+00, -7.09390e+00],
           [ 3.94384e-01, -3.06794e-01, -3.71830e-01,  ..., -5.82335e+00, -7.12701e+00, -7.08062e+00],
           [-1.58947e-01,  6.87067e-02, -4.66916e-02,  ..., -5.87629e+00, -7.24141e+00, -7.18403e+00],
           ...,
           [ 4.32366e-01,  1.11909e-01, -8.53149e-02,  ..., -6.09452e+00, -7.18433e+00, -7.12270e+00],
           [-9.10478e-02, -1.35591e-01, -4.50653e-01,  ..., -5.93476e+00, -7.15415e+00, -7.02197e+00],
           [-1.18967e+00, -2.51574e-01, -7.26000e-01,  ..., -6.27848e+00, -7.24227e+00, -7.16629e+00]],

          ...,

          [[ 1.02686e+00,  5.63578e-01, -8.30652e-01,  ..., -6.25351e+00, -7.41619e+00, -7.15259e+00],
           [-2.43900e-01,  5.25664e-01, -5.28058e-01,  ..., -6.12479e+00, -7.40968e+00, -7.18322e+00],
           [-3.54038e-01,  2.47667e-01, -1.70432e-01,  ..., -6.33727e+00, -7.40687e+00, -7.18712e+00],
           ...,
           [ 6.32128e-01,  4.32312e-01, -1.32035e-01,  ..., -6.18117e+00, -7.30731e+00, -6.95593e+00],
           [ 3.94113e-01,  6.16709e-01, -5.63924e-01,  ..., -5.93805e+00, -7.35923e+00, -6.95413e+00],
           [-1.06059e+00,  4.82612e-01, -7.80597e-01,  ..., -6.37532e+00, -7.45216e+00, -7.19456e+00]],

          [[ 1.20858e+00,  1.80244e-01, -7.89369e-01,  ..., -6.11568e+00, -7.35459e+00, -7.09486e+00],
           [-1.39298e-01,  1.68622e-01, -4.93596e-01,  ..., -6.21621e+00, -7.43262e+00, -7.26704e+00],
           [-3.54562e-01, -3.36068e-02, -1.44189e-01,  ..., -6.25033e+00, -7.39523e+00, -7.22810e+00],
           ...,
           [ 5.83880e-01,  1.21850e-01, -1.18459e-01,  ..., -6.14304e+00, -7.30411e+00, -7.01722e+00],
           [ 2.86791e-01,  1.38399e-01, -5.25024e-01,  ..., -6.08743e+00, -7.33589e+00, -7.08005e+00],
           [-1.19892e+00,  2.70065e-01, -7.52361e-01,  ..., -6.36064e+00, -7.38901e+00, -7.25556e+00]],

          [[ 7.54093e-01, -7.22691e-01, -6.77260e-01,  ..., -6.43106e+00, -7.38478e+00, -7.28261e+00],
           [-9.27329e-02, -1.35348e+00, -4.60573e-01,  ..., -6.44353e+00, -7.42786e+00, -7.30337e+00],
           [-3.44885e-01, -1.15564e+00, -2.00896e-01,  ..., -6.46835e+00, -7.42813e+00, -7.35574e+00],
           ...,
           [ 4.55702e-01, -1.14849e+00, -1.36316e-01,  ..., -6.40351e+00, -7.37721e+00, -7.25393e+00],
           [ 1.77520e-01, -1.34219e+00, -4.87102e-01,  ..., -6.39269e+00, -7.36359e+00, -7.20725e+00],
           [-9.97073e-01, -1.08836e+00, -7.77924e-01,  ..., -6.46801e+00, -7.28893e+00, -7.20197e+00]]],


         [[[ 2.12316e-01,  5.17609e-01, -7.55496e-01,  ..., -5.91197e+00, -6.63398e+00, -6.56021e+00],
           [ 2.72088e-01,  1.40224e+00, -9.63117e-01,  ..., -5.50335e+00, -6.52540e+00, -6.45309e+00],
           [-3.27636e-01,  1.28276e+00, -7.94481e-01,  ..., -5.54693e+00, -6.64384e+00, -6.56334e+00],
           ...,
           [ 2.89831e-01,  1.14850e+00, -7.87276e-01,  ..., -5.64888e+00, -6.63960e+00, -6.56211e+00],
           [-2.15276e-01,  1.09407e+00, -9.75548e-01,  ..., -5.51857e+00, -6.53177e+00, -6.48915e+00],
           [-3.33783e-01,  4.82589e-01, -9.15079e-01,  ..., -5.85854e+00, -6.59307e+00, -6.58084e+00]],

          [[ 6.05653e-01,  1.74716e-01, -9.51021e-01,  ..., -5.81085e+00, -6.65037e+00, -6.55896e+00],
           [ 4.05545e-01,  2.46452e-01, -9.94158e-01,  ..., -5.62595e+00, -6.73472e+00, -6.65239e+00],
           [-3.24258e-01,  2.59574e-01, -7.85015e-01,  ..., -5.59541e+00, -6.81270e+00, -6.70372e+00],
           ...,
           [ 3.66682e-01,  3.40977e-01, -8.01231e-01,  ..., -5.75141e+00, -6.77906e+00, -6.63364e+00],
           [-3.52845e-01,  3.79876e-01, -1.00017e+00,  ..., -5.65316e+00, -6.71336e+00, -6.56421e+00],
           [-6.97348e-01,  3.14352e-01, -1.01103e+00,  ..., -5.89050e+00, -6.66089e+00, -6.59130e+00]],

          [[ 5.02837e-01, -2.49637e-01, -8.83758e-01,  ..., -5.71148e+00, -6.72070e+00, -6.60138e+00],
           [ 6.33624e-01, -1.34442e-01, -9.43467e-01,  ..., -5.52306e+00, -6.78667e+00, -6.66483e+00],
           [-2.31910e-01,  1.72562e-01, -7.59517e-01,  ..., -5.53641e+00, -6.90177e+00, -6.75429e+00],
           ...,
           [ 3.01600e-01,  2.16206e-01, -7.73077e-01,  ..., -5.73228e+00, -6.86353e+00, -6.70716e+00],
           [-6.14865e-01,  7.32349e-02, -9.17968e-01,  ..., -5.61263e+00, -6.79073e+00, -6.60947e+00],
           [-6.66241e-01, -1.25339e-02, -9.04497e-01,  ..., -5.86204e+00, -6.72862e+00, -6.62507e+00]],

          ...,

          [[ 4.38232e-01,  4.84284e-01, -1.00809e+00,  ..., -5.93827e+00, -6.89747e+00, -6.64538e+00],
           [ 4.30427e-01,  5.38997e-01, -9.92167e-01,  ..., -5.87233e+00, -7.02842e+00, -6.77595e+00],
           [-3.67034e-01,  3.02129e-01, -8.38339e-01,  ..., -6.00836e+00, -7.03554e+00, -6.77269e+00],
           ...,
           [ 5.32182e-01,  4.73973e-01, -8.23376e-01,  ..., -5.91327e+00, -7.01828e+00, -6.62620e+00],
           [-5.03106e-01,  5.44721e-01, -9.93778e-01,  ..., -5.74079e+00, -7.01051e+00, -6.61945e+00],
           [-1.06603e+00,  4.36711e-01, -1.03458e+00,  ..., -6.00955e+00, -6.89207e+00, -6.64005e+00]],

          [[ 7.25152e-01, -4.98634e-02, -9.81108e-01,  ..., -5.85099e+00, -6.85021e+00, -6.59669e+00],
           [ 4.73468e-01, -1.68403e-01, -9.76622e-01,  ..., -5.99847e+00, -7.02675e+00, -6.82026e+00],
           [-3.60984e-01, -2.27406e-01, -8.23844e-01,  ..., -5.98752e+00, -7.03918e+00, -6.80660e+00],
           ...,
           [ 4.93489e-01, -1.38783e-01, -8.12309e-01,  ..., -5.92841e+00, -7.00246e+00, -6.66353e+00],
           [-5.12108e-01, -2.93046e-01, -9.80900e-01,  ..., -5.89920e+00, -6.95978e+00, -6.68016e+00],
           [-1.13159e+00,  3.63814e-02, -1.05918e+00,  ..., -6.02223e+00, -6.83652e+00, -6.66215e+00]],

          [[ 2.59415e-01, -2.51208e-01, -9.22397e-01,  ..., -6.08896e+00, -6.84053e+00, -6.70127e+00],
           [ 1.68959e-01, -1.25276e+00, -9.85456e-01,  ..., -6.09095e+00, -6.91233e+00, -6.72301e+00],
           [-2.94432e-01, -1.17766e+00, -8.40197e-01,  ..., -6.11813e+00, -6.95376e+00, -6.80478e+00],
           ...,
           [ 3.48972e-01, -1.35094e+00, -8.13097e-01,  ..., -6.07936e+00, -6.93244e+00, -6.73717e+00],
           [-2.55364e-01, -1.30151e+00, -9.87395e-01,  ..., -6.06478e+00, -6.87384e+00, -6.65677e+00],
           [-5.06121e-01, -4.06958e-01, -9.63424e-01,  ..., -6.11036e+00, -6.74459e+00, -6.59334e+00]]]]], device='cuda:0')]]
:List inputs to traced functions must have consistent element type. Found Tensor and List[Tensor]

Environment

YOLOv5 🚀 2022-9-9 Python-3.7.13 torch-1.12.1+cu113 CUDA:0 (Tesla P100-PCIE-16GB, 16281MiB)

Minimal Reproducible Example

import torch

model = torch.hub.load('ultralytics/yolov5', 'yolov5s', verbose=False, force_reload=True)
torch.jit.trace(model, [torch.zeros([1, 3, 640, 640], dtype=torch.float32)])

Additional

v6.1 works fine, but breaks after updating to v6.2

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@iann838 iann838 added the bug Something isn't working label Sep 9, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2022

👋 Hello @paaksing, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email support@ultralytics.com.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on macOS, Windows, and Ubuntu every 24 hours and on every commit.

@iann838
Copy link
Author

iann838 commented Sep 10, 2022

This indirectly affects compilation of artifacts to aws neuron runtime (torch.neuron.trace), cutting out access to critical low cost high throughput hardware that supports many infrastructures.

@glenn-jocher
Copy link
Member

glenn-jocher commented Sep 10, 2022

@paaksing 👋 Hello! Thanks for asking about Export Formats. YOLOv5 🚀 offers export to most popular formats used today. See our TFLite, ONNX, CoreML, TensorRT Export Tutorial for details.

Formats

YOLOv5 inference is officially supported in 11 formats:

💡 ProTip: TensorRT may be up to 2-5X faster than PyTorch on GPU benchmarks
💡 ProTip: ONNX and OpenVINO may be up to 2-3X faster than PyTorch on CPU benchmarks

Format export.py --include Model
PyTorch - yolov5s.pt
TorchScript torchscript yolov5s.torchscript
ONNX onnx yolov5s.onnx
OpenVINO openvino yolov5s_openvino_model/
TensorRT engine yolov5s.engine
CoreML coreml yolov5s.mlmodel
TensorFlow SavedModel saved_model yolov5s_saved_model/
TensorFlow GraphDef pb yolov5s.pb
TensorFlow Lite tflite yolov5s.tflite
TensorFlow Edge TPU edgetpu yolov5s_edgetpu.tflite
TensorFlow.js tfjs yolov5s_web_model/

CPU Benchmarks on Colab Pro+ CPU instance

Full CPU benchmarks

benchmarks: weights=/content/yolov5/yolov5s.pt, imgsz=640, batch_size=1, data=/content/yolov5/data/coco128.yaml, device=cpu, half=False, test=False
Checking setup...
YOLOv5 🚀 v6.1-135-g7926afc torch 1.10.0+cu111 CPU
Setup complete ✅ (8 CPUs, 51.0 GB RAM, 41.5/166.8 GB disk)

Benchmarks complete (241.20s)
                   Format  mAP@0.5:0.95  Inference time (ms)
0                 PyTorch        0.4623               127.61
1             TorchScript        0.4623               131.23
2                    ONNX        0.4623                69.34
3                OpenVINO        0.4623                66.52
4                TensorRT           NaN                  NaN
5                  CoreML           NaN                  NaN
6   TensorFlow SavedModel        0.4623               123.79
7     TensorFlow GraphDef        0.4623               121.57
8         TensorFlow Lite        0.4623               316.61
9     TensorFlow Edge TPU           NaN                  NaN
10          TensorFlow.js           NaN                  NaN

GPU Benchmarks on Colab Pro+ V100 instance

Full GPU benchmarks

benchmarks: weights=/content/yolov5/yolov5s.pt, imgsz=640, batch_size=1, data=/content/yolov5/data/coco128.yaml, device=0, half=False, test=False
Checking setup...
YOLOv5 🚀 v6.1-135-g7926afc torch 1.10.0+cu111 CUDA:0 (Tesla V100-SXM2-16GB, 16160MiB)
Setup complete ✅ (8 CPUs, 51.0 GB RAM, 46.7/166.8 GB disk)

Benchmarks complete (458.07s)
                   Format  mAP@0.5:0.95  Inference time (ms)
0                 PyTorch        0.4623                10.19
1             TorchScript        0.4623                 6.85
2                    ONNX        0.4623                14.63
3                OpenVINO           NaN                  NaN
4                TensorRT        0.4617                 1.89
5                  CoreML           NaN                  NaN
6   TensorFlow SavedModel        0.4623                21.28
7     TensorFlow GraphDef        0.4623                21.22
8         TensorFlow Lite           NaN                  NaN
9     TensorFlow Edge TPU           NaN                  NaN
10          TensorFlow.js           NaN                  NaN

Good luck 🍀 and let us know if you have any other questions!

@glenn-jocher
Copy link
Member

@paaksing can you provide a reproducible successful command with v6.1 please? This should help us to understand the issue, as the above are not part of our CI or standard use cases.

@iann838
Copy link
Author

iann838 commented Sep 10, 2022

@glenn-jocher

!pip install torch==1.8.1 torchvision==0.9.1

import torch
import requests

with open("yolov5s61.pt", "wb+") as f:
    f.write(requests.get("https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5s.pt").content)

model = torch.hub.load('ultralytics/yolov5:v6.1', 'custom', path="yolov5s61.pt", force_reload=True)
try:
    torch.jit.trace(model, [torch.zeros([1, 3, 640, 640])])
except Exception:
    torch.jit.trace(model, [torch.zeros([1, 3, 640, 640])])

This works, and is very similar with torch.neuron.trace (See #8619), I don't know what is the reason that the tracing has to be called twice 🤷, it already looks weird in v6.1 having to catch and repeat the call. Also another issue is that torch.hub.load, by specifying model = torch.hub.load('ultralytics/yolov5:v6.1', "yolov5s.pt", force_reload=True) it will download yolov5s from v6.2 regarless of the repository tag/branch, so I needed to download the weights manually and use it as custom. This code uses torch 1.8.1 because 1.12 gives the error on #6948

@glenn-jocher
Copy link
Member

@paaksing yes thanks! The Try Except appears redundant, perhaps it exists to catch model download issues.

In any case the v6.1 and v6.2 detection models are exactly identical files, same hash, same weights, they have not been retrained, only classification models have been added.

When we export torchscript models in export.py we also run torch.jit.trace and this export works correctly (tested every 24 hours in CI tests):

yolov5/export.py

Lines 112 to 126 in 4e8504a

@try_export
def export_torchscript(model, im, file, optimize, prefix=colorstr('TorchScript:')):
# YOLOv5 TorchScript model export
LOGGER.info(f'\n{prefix} starting export with torch {torch.__version__}...')
f = file.with_suffix('.torchscript')
ts = torch.jit.trace(model, im, strict=False)
d = {"shape": im.shape, "stride": int(max(model.stride)), "names": model.names}
extra_files = {'config.txt': json.dumps(d)} # torch._C.ExtraFilesMap()
if optimize: # https://pytorch.org/tutorials/recipes/mobile_interpreter.html
optimize_for_mobile(ts)._save_for_lite_interpreter(str(f), _extra_files=extra_files)
else:
ts.save(str(f), _extra_files=extra_files)
return f, None

@iann838
Copy link
Author

iann838 commented Sep 10, 2022

@glenn-jocher I tried to get as close as that script, but the same error keeps coming, maybe is the way the model is loaded using torch.hub.load be any different ? I tried modifying inplace and fuse as well with no success. Let me try loading the models without hub.

@glenn-jocher
Copy link
Member

@paaksing I tested your code with current torch and it fails:

Screenshot 2022-09-10 at 22 28 01

Also installed older torch as in your example and also fails:
Screenshot 2022-09-10 at 22 30 26

@iann838
Copy link
Author

iann838 commented Sep 10, 2022

@glenn-jocher
image
Looks fine for me

@iann838
Copy link
Author

iann838 commented Sep 10, 2022

Also, it appears that the first trace call will always raise an exception, except the second one

@glenn-jocher
Copy link
Member

Got it. When running two it works, this is probably just because the model needs a warmup to build grids. Anyway, v6.2 works correctly for me when I run it twice:

Screenshot 2022-09-10 at 22 37 55

@glenn-jocher
Copy link
Member

@paaksing ok I figured this out. v6.2 passes the test, but master does not, so a change between v6.2 and now has caused this. You can use git bisect to track this down by passing in the exact commit hash, i.e. here from July 30th this commit passes. Can you help test commits until you find the first that fails?

commit hash 1e89807
1e89807

All commits at https://github.com/ultralytics/yolov5/commits/master

!pip install torch==1.8.1 torchvision==0.9.1

import torch
import requests

model = torch.hub.load('ultralytics/yolov5:1e89807d9a208727e3f0e9bf26a1e286d0ce416b', 'custom', path="https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5s.pt", force_reload=True, autoshape=False)
model.cpu()
try:
    torch.jit.trace(model, [torch.zeros([1, 3, 640, 640])])
except Exception:
    torch.jit.trace(model, [torch.zeros([1, 3, 640, 640])])

@iann838
Copy link
Author

iann838 commented Sep 10, 2022

@glenn-jocher sure

@iann838
Copy link
Author

iann838 commented Sep 10, 2022

@glenn-jocher found it, 7aa263c

@glenn-jocher
Copy link
Member

glenn-jocher commented Sep 10, 2022

@paaksing oh that was fast. Yes that makes sense, that changed DetectMultiBackend behavior. Ok I'll to find a fix, and I'll also try to add this workflow to the CI to safeguard the workflow in the future.

@iann838
Copy link
Author

iann838 commented Sep 10, 2022

@glenn-jocher One by one is slow, so I went the binary search method. Thanks, I'll wait for news

@glenn-jocher
Copy link
Member

@paaksing ok #9363 appears to be working. As long as you leave autoshape=True (the default) on PyTorch Hub model load you should be fine to jit trace.

I'm going to add some CI and then merge.

@glenn-jocher glenn-jocher linked a pull request Sep 10, 2022 that will close this issue
@glenn-jocher
Copy link
Member

glenn-jocher commented Sep 10, 2022

@paaksing here's the test script that traces v6.2 models with latest torch and PR (cleaned up and using warmup rather than Try Except:

import torch
import requests

model = torch.hub.load('ultralytics/yolov5:update/torch', 'yolov5s', force_reload=True, skip_validation=True)
model.cpu()
im = torch.zeros([1, 3, 640, 640])
model(im)  # warmup, build grids
torch.jit.trace(model, [im])

EDIT: note skip_validation=True required with latest torch releases

@iann838
Copy link
Author

iann838 commented Sep 10, 2022

@glenn-jocher Thanks a lot, It's working and now the script looks cleaner as well, closing this.

@glenn-jocher
Copy link
Member

@paaksing good news 😃! Your original issue may now be fixed ✅ in PR #9363. This PR also adds torch.jit.trace() CI to protect from tracing issues arising in the future.

To receive this update:

  • Gitgit pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
  • PyTorch Hub – Force-reload model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
  • Notebooks – View updated notebooks Open In Colab Open In Kaggle
  • Dockersudo docker pull ultralytics/yolov5:latest to update your image Docker Pulls

Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants