Error has no attribute set_intersection

1.Error 错误,我安装coco

    from pycocotools.coco import COCO

ModuleNotFoundError: No module named 'pycocotools'

2.下载

git clone https://github.com/waleedka/coco

安装里面的PythonApi,需要gcc环境。

3.替代intersection

AttributeError: module 'tensorflow_core._api.v2.sets' has no attribute 'set_intersection'

直接修改为intersection

4. 直接用sparse.to_dense

AttributeError: module 'tensorflow' has no attribute 'sparse_tensor_to_dense'

 Create a tf.sparse.SparseTensor and use tf.sparse.to_dense instead.

5.保存错误

"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/keras/engine/saving.py", line 1328, in load_weights_from_hdf5_group_by_name
    str(weight_values[i].shape) + '.')
ValueError: Layer #395 (named "mrcnn_mask"), weight <tf.Variable 'mrcnn_mask_1/kernel:0' shape=(1, 1, 256, 3) dtype=float32, numpy=
array([[[[ 0.03199011,  0.00932376,  0.09004048],
         [ 0.04575497, -0.10449269,  0.08610004],
         [ 0.1350683 , -0.01978333,  0.0702861 ],
         [-0.09458333, -0.14473972,  0.0501876 ],
         [-0.11459215,  0.15159783, -0.02414097],
         [ 0.13277593, -0.09274703, -0.02502578],
         [-0.08014645, -0.00717494,  0.08668581],
         [-0.05309013,  0.09716588, -0.04272914],
         [ 0.05203207,  0.06497586, -0.13705699],
         [ 0.14653206,  0.07635157, -0.08679264],
         [ 0.01668522, -0.03125288,  0.03203101],
         [ 0.12877646,  0.14991081,  0.12936318],
         [-0.00239547, -0.13436869, -0.11989571],
         [ 0.04525788, -0.01235139, -0.12180367],
         [-0.11565949,  0.03931315, -0.00123671],
         [ 0.10717776,  0.01115946, -0.09570184],
         [ 0.09756908,  0.12623882, -0.06896902],
         [ 0.11564705,  0.00239459,  0.07853587],
         [ 0.11164176, -0.07750946,  0.12053412],
         [-0.15184511, -0.06791732, -0.02493902],
         [-0.05625039, -0.04652449,  0.09078188],
         [-0.04280429, -0.11489867,  0.00305104],
         [ 0.11671433,  0.00177856,  0.00962752],
         [-0.09531925, -0.05239157,  0.07811938],
         [ 0.09391904, -0.05088271,  0.14318246],
         [-0.00026657,  0.03797738,  0.03297628],
         [-0.0487617 , -0.01501161, -0.09538282],
         [-0.07865823, -0.10753638, -0.14080957],
         [-0.09660059,  0.05991492, -0.11546329],
         [ 0.07927401, -0.09645601, -0.11737339],
         [-0.03859501,  0.13622549, -0.04850195],
         [-0.00276893,  0.0952246 , -0.04194855],
         [ 0.06351857, -0.05721624,  0.04568921],
         [-0.11767701, -0.13658561,  0.05669159],
         [-0.12271977, -0.04542256,  0.13184288],
         [-0.10238272,  0.03983548,  0.05035621],
         [ 0.12707472, -0.14041889,  0.09542608],
         [ 0.00856572,  0.10109705, -0.03057291],
         [ 0.06211494,  0.02622877,  0.02869746],
         [-0.04425669,  0.09927499,  0.10574189],
         [ 0.1352264 ,  0.11560601,  0.11195523],
         [ 0.02179943, -0.03159417, -0.13847736],
         [-0.08839204, -0.11292648,  0.0554657 ],
         [ 0.0664537 , -0.08185015,  0.14999005],
         [ 0.15007839, -0.11052221, -0.13569836],
         [-0.06022395,  0.00658366, -0.06400251],
         [-0.04854187, -0.10982424,  0.11133912],
         [-0.01515087, -0.11715697, -0.07920267],
         [-0.14801408, -0.12018231, -0.03212877],
         [-0.08491766, -0.14188512,  0.03261961],
         [-0.02920372, -0.1517374 ,  0.09998503],
         [-0.02912439,  0.11682686, -0.12847207],
         [-0.11971304, -0.0052603 ,  0.00885622],
         [ 0.11163792, -0.08886905,  0.05274241],
         [-0.11393566,  0.07498725, -0.08171218],
         [-0.150682  , -0.07980219, -0.01389022],
         [-0.10245976, -0.14030479, -0.00126588],
         [ 0.12164313, -0.13682054,  0.07180125],
         [ 0.06105742,  0.14901507,  0.08048531],
         [-0.09718483, -0.00534965,  0.0584394 ],
         [ 0.06872381, -0.05131472,  0.05193137],
         [-0.14677024, -0.05744758,  0.13957852],
         [ 0.00693744,  0.03225712, -0.12467955],
         [ 0.06624389, -0.01258577, -0.09798868],
         [-0.08775054, -0.05556466, -0.02295288],
         [ 0.11916661, -0.1360729 ,  0.10321775],
         [-0.11504619, -0.02163574, -0.09738564],
         [-0.02960488,  0.02527152,  0.11692274],
         [-0.05541039, -0.04242066,  0.0418743 ],
         [-0.0704572 ,  0.03238837, -0.11416137],
         [-0.05464642,  0.10446417,  0.12175116],
         [ 0.01333164, -0.05672979, -0.13565515],
         [-0.04452156,  0.08534731,  0.04873616],
         [ 0.11652851, -0.10117472,  0.06930505],
         [-0.07522609, -0.08009557, -0.11954585],
         [ 0.00500742,  0.11243048,  0.10345843],
         [-0.13643828, -0.08370005, -0.05262563],
         [-0.12085394, -0.09132232,  0.01017638],
         [-0.02453534,  0.09732026,  0.0560635 ],
         [-0.08331035,  0.0077564 , -0.09048058],
         [-0.04096053,  0.09969088, -0.13438088],
         [-0.02565205, -0.09176303,  0.1461811 ],
         [ 0.14659709,  0.11691555, -0.04454602],
         [-0.06905923,  0.08990215,  0.10676473],
         [ 0.13256612, -0.13565184,  0.10750002],
         [ 0.08192897,  0.0354417 , -0.05453508],
         [-0.14804417, -0.00031295, -0.02517852],
         [ 0.04198606,  0.14748225,  0.12202814],
         [-0.06828241, -0.11863248,  0.06605171],
         [ 0.0867766 ,  0.03370219, -0.1202079 ],
         [ 0.0925886 , -0.02672829,  0.13127413],
         [-0.07957096,  0.06874457,  0.12016585],
         [-0.11926426,  0.05075991, -0.10678746],
         [-0.10444976, -0.11147623, -0.08690698],
         [-0.05031135,  0.13626787,  0.05478965],
         [ 0.09734628,  0.10256276, -0.05207547],
         [-0.0244066 , -0.11698503,  0.08059748],
         [-0.08445412, -0.00137605, -0.02180248],
         [ 0.1500746 , -0.09588702, -0.10990375],
         [-0.10570052, -0.06891089,  0.074927  ],
         [-0.13654055, -0.11521743,  0.14483601],
         [-0.13738254, -0.08498084,  0.02382708],
         [ 0.0589231 ,  0.04772778, -0.02541497],
         [ 0.07673053, -0.0887288 , -0.05958866],
         [-0.05464587, -0.136387  , -0.08033489],
         [ 0.0324378 ,  0.14786223, -0.09355161],
         [-0.09083831,  0.14589635, -0.07936364],
         [ 0.01210205,  0.0026027 ,  0.05329037],
         [-0.0767552 , -0.00367263,  0.03648078],
         [-0.06607645,  0.05585241,  0.10360163],
         [ 0.06621851, -0.11248191, -0.14123124],
         [ 0.04890634, -0.01358062, -0.04231491],
         [-0.14026913, -0.06787402, -0.01470497],
         [-0.06501676, -0.02319333, -0.07185873],
         [ 0.03511094,  0.03478949,  0.13363907],
         [ 0.0988268 , -0.08237498, -0.10570044],
         [ 0.09993929,  0.11990383,  0.01837437],
         [-0.02474901,  0.08314157,  0.11814928],
         [ 0.06405132, -0.09008943,  0.05753572],
         [ 0.06448546, -0.04499266, -0.1033641 ],
         [ 0.07502346,  0.14683941, -0.01939395],
         [-0.14725472, -0.08088434,  0.00376131],
         [-0.05397853,  0.08296695, -0.00146264],
         [-0.14286445, -0.05858957,  0.12374336],
         [ 0.09567161, -0.07995561,  0.11843681],
         [ 0.12790796, -0.03317267, -0.10670736],
         [ 0.06969345,  0.04929952,  0.08986843],
         [-0.0867058 , -0.09922346, -0.03431317],
         [-0.10853118, -0.13786355,  0.08297211],
         [ 0.1253703 ,  0.09062602,  0.06620212],
         [-0.1234042 ,  0.03501506, -0.07359236],
         [ 0.0101361 ,  0.07550468,  0.04776685],
         [ 0.04679015, -0.05912003, -0.08136439],
         [ 0.13756925,  0.11867875, -0.10554509],
         [-0.07799993,  0.05946833, -0.14173219],
         [ 0.1405805 ,  0.14933124,  0.02430883],
         [-0.04141079, -0.01417971, -0.0985509 ],
         [ 0.09223126,  0.08164375, -0.04111453],
         [ 0.02469988, -0.09547903, -0.05591291],
         [ 0.07384953,  0.12434995, -0.05227843],
         [-0.06905288, -0.1237194 ,  0.02178191],
         [-0.07490828, -0.14725298,  0.10068339],
         [-0.02017538,  0.07791178,  0.09166194],
         [-0.0298117 ,  0.1283068 ,  0.04267097],
         [-0.08082667, -0.00040382,  0.00889733],
         [ 0.11534894, -0.05894167, -0.13305347],
         [ 0.04820928, -0.07654484,  0.05331914],
         [-0.03137434,  0.05907311, -0.05752759],
         [-0.06147339, -0.11105746,  0.02562697],
         [-0.03623664, -0.04203811, -0.07999016],
         [-0.00180829, -0.02807138,  0.12811998],
         [-0.04441665,  0.04154287, -0.14555548],
         [ 0.09004667, -0.15178676,  0.12366903],
         [-0.00565669, -0.09242824, -0.09672266],
         [-0.11742125, -0.05044653,  0.09115826],
         [-0.03989056, -0.12893772,  0.07980077],
         [-0.09763527,  0.08902444, -0.1020128 ],
         [-0.144712  , -0.05868733,  0.07849418],
         [-0.03374058,  0.00405641,  0.11707643],
         [ 0.03678317, -0.11164282, -0.10605915],
         [-0.02599743,  0.06548734, -0.01637582],
         [-0.08439501, -0.04758941, -0.04780187],
         [ 0.1044699 ,  0.11436802, -0.12486208],
         [-0.05879333,  0.06140906, -0.11445458],
         [ 0.04382403, -0.07783576,  0.08516145],
         [-0.08450503, -0.05756544,  0.10743645],
         [ 0.0587758 ,  0.14487875, -0.0218154 ],
         [ 0.07219003, -0.04039777,  0.0806244 ],
         [-0.06689725, -0.01652254, -0.14154056],
         [-0.0180735 ,  0.09940869, -0.03059497],
         [ 0.02130628, -0.03173213,  0.07238545],
         [ 0.09998113, -0.03000801,  0.04782082],
         [-0.04419722, -0.01771232, -0.07576297],
         [ 0.08477312,  0.12616065, -0.14204246],
         [-0.01276381,  0.11483249,  0.11337224],
         [ 0.07769173,  0.1476804 , -0.03116274],
         [ 0.10644472,  0.04080078,  0.07770526],
         [-0.11056449,  0.00087625,  0.00584741],
         [ 0.05753884,  0.08819242,  0.06882785],
         [ 0.05042911,  0.09215361,  0.08441584],
         [ 0.11046281, -0.08112242, -0.10143534],
         [ 0.11032033,  0.09844664,  0.06415528],
         [ 0.04174998,  0.07802823,  0.1406185 ],
         [ 0.06727454,  0.14090532, -0.06658576],
         [ 0.068964  ,  0.14170769, -0.07151333],
         [-0.08502279,  0.01421472,  0.02644472],
         [ 0.12663102,  0.05364133, -0.00036909],
         [ 0.00626513,  0.03498816, -0.07612513],
         [ 0.09590186,  0.08395758, -0.09850779],
         [-0.11153567,  0.14604282,  0.05357635],
         [ 0.13725895, -0.08433335,  0.0948458 ],
         [ 0.06717907, -0.07852404,  0.0093578 ],
         [ 0.08541742,  0.01754068, -0.13465893],
         [ 0.14612663,  0.00216767,  0.13903278],
         [ 0.14963159,  0.09792459,  0.11377552],
         [-0.06714982, -0.01699443, -0.00156918],
         [-0.02269873, -0.11415356,  0.04400314],
         [-0.10269843,  0.13528061,  0.00323139],
         [-0.14996864,  0.0741635 , -0.0755729 ],
         [-0.09047437,  0.02750354, -0.0010311 ],
         [-0.06858839,  0.06129645,  0.02331951],
         [ 0.1483858 , -0.12801567, -0.06821059],
         [ 0.129168  ,  0.13246351,  0.05433993],
         [-0.1154    , -0.14300464,  0.07189813],
         [-0.02563322,  0.06663778, -0.08625078],
         [-0.08860455, -0.06783418, -0.10370401],
         [ 0.125096  , -0.1217152 , -0.0911423 ],
         [ 0.01409577, -0.12556487, -0.02856378],
         [ 0.11695194, -0.12375337,  0.08811806],
         [-0.00572668,  0.0518205 , -0.03273627],
         [ 0.12611246,  0.06039001, -0.02076994],
         [-0.13070819,  0.0119974 ,  0.11392915],
         [ 0.03061864, -0.14842519, -0.11157362],
         [-0.02415518, -0.08849017,  0.10037634],
         [ 0.09369028,  0.08351091, -0.04961077],
         [-0.01046298,  0.06690934, -0.09908836],
         [ 0.01232417,  0.09379786,  0.08001105],
         [ 0.09176707, -0.11507352,  0.11281183],
         [ 0.07452315, -0.05178919, -0.09084876],
         [-0.05683231, -0.14747216, -0.00699481],
         [-0.05646711,  0.01515236,  0.14086276],
         [-0.09915096, -0.05628033,  0.07310708],
         [ 0.11717984, -0.01837604, -0.00992966],
         [ 0.13297269, -0.0082199 ,  0.08595736],
         [ 0.09579608, -0.01402116,  0.12779054],
         [-0.07048965, -0.10688373, -0.0446199 ],
         [-0.10691984,  0.09424846,  0.08167836],
         [-0.130165  ,  0.13985449, -0.08360555],
         [-0.03502032,  0.13529709,  0.00507636],
         [ 0.02179202,  0.0183928 ,  0.09253721],
         [-0.03882261, -0.08641198, -0.07626252],
         [ 0.02635625, -0.03261855, -0.01618233],
         [-0.06806519,  0.13446233,  0.03825843],
         [ 0.14607215, -0.05891231,  0.08137734],
         [ 0.01072411,  0.12677225, -0.14676946],
         [ 0.14793658,  0.0405194 ,  0.10142675],
         [ 0.01570791, -0.10565831,  0.09621111],
         [-0.09957096,  0.04731981, -0.05575814],
         [ 0.14205733, -0.06674517,  0.05086471],
         [-0.01331785,  0.07917324, -0.13811646],
         [-0.05363191, -0.05480151,  0.08220305],
         [ 0.04230417,  0.07497729, -0.05583279],
         [ 0.03528686,  0.10179174, -0.13006821],
         [ 0.02074686, -0.05733918, -0.00232948],
         [-0.14911209, -0.10764121, -0.07959305],
         [ 0.01369558, -0.11288345, -0.02269745],
         [ 0.10299739,  0.02334078,  0.03208075],
         [-0.10067311, -0.09677549, -0.07247225],
         [ 0.04018058,  0.11692199,  0.06349291],
         [-0.01247989, -0.14318967,  0.05202477],
         [ 0.07455806, -0.13688296, -0.00541489],
         [-0.06231811, -0.06392935, -0.06741171],
         [ 0.00135617, -0.06229343,  0.00603437],
         [-0.03036425, -0.06238191,  0.00517325],
         [-0.12594648, -0.00243527,  0.01158789],
         [-0.01292515,  0.10491204,  0.06789891]]]], dtype=float32)> has shape (1, 1, 256, 3), but the saved weight has shape (81, 256, 1, 1).

猜你喜欢

转载自blog.csdn.net/keny88888/article/details/106152733