Planet Classification Challenge

I’m getting predictions with learn.TTA(), but I’m getting strange results. I take the mean just like in lesson2, but I get very bad f2 metric on validation set unless I use thrshold of 1.21. Does this mean that instead of logs of predictions TTA returns log§ + 1 ?

Since we can’t see the code where you use TTA, it’s hard to know what’s happening here…

right, sorry. This is how I get predictions:

Looks fine - something else is going on in your model… I don’t think it’s specific to TTA.

I see. Thank you so much. I was wondering why I am getting a three dimensional output but did not realize the code had been changed.

I just asked the same question here: bn_unfreeze(True) @ecdrid - Did you figure out how they work differently?

Have you resolved this issue? I was getting similar results (0.48 accuracy). It seems that the newer version of fastai.learn.TTA() does output probabilities, not log_probs. So instead of taking the exp and then the mean, I just took the mean (raw_preds = learn.TTA(), preds=np.mean(raw_preds,0) ) and then accuracy results improved to 0.92.
@jeremy can you comment on this?

Also, I have 16 G RAM but whenever I try to run learn.TTA(is_test=True), my kernel dies. I have tried adding up to 48 G of swapfiles to my NVMe SSD drive but it won’t help. Any suggestion?

In this particular competition I had reduced my image size to 300x300 and then it didn’t run out of memory…

I followed jeremy’s notebook so the image size was 256. Isn’t the case that 300x300 take up more memeory?

I don’t believe I’ve done anything like that- but check the source to be sure

The original images are 256x256 so no point using bigger

I’m getting this error when creating the kaggle submission file:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-48-0d8cb23506ec> in <module>()
      3 
      4 for i in range(len(test_fnames)):
----> 5     test_fnames[i] = test_fnames[i].split("/")[1].split(".")[0]
      6 
      7 classes = np.array(data.classes, dtype=str)

IndexError: list index out of range

Here is the number of classes:


Out[53]:
['agriculture',
 'artisinal_mine',
 'bare_ground',
 'blooming',
 'blow_down',
 'clear',
 'cloudy',
 'conventional_mine',
 'cultivation',
 'habitation',
 'haze',
 'partly_cloudy',
 'primary',
 'road',
 'selective_logging',
 'slash_burn',
 'water']
size = len(data.test_ds.fnames)
size
1000

This is the code I am using the same as listed above in this thread:

#create list for Kaggle submission
test_fnames = data.test_ds.fnames

for i in range(len(test_fnames)):
    test_fnames[i] = test_fnames[i].split("/")[1].split(".")[0]

classes = np.array(data.classes, dtype=str)
res = [" ".join(classes[np.where(pp > 0.2)]) for pp in tta[0]] 

submission = pd.DataFrame(data=res)

submission.columns = ["tags"]

submission.insert(0, 'image_name', test_fnames)

submission.to_csv(PATH+"Planet_submission_2017_12_18_01.csv", index=False)

What am i doing wrong?

You nay want to check what the test_fnames are. It’s possible that the it’s not delimited by / so, the index out of range might be the .split("/")[1].,on a filename that doesn’t have the slash. Check your test_fnames

@ramesh thanks for that. The error i get now is

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-178-d6c1990fd25e> in <module>()
----> 1 res = [" ".join(classes[np.where(pp > 0.2)]) for pp in tta[0]]

<ipython-input-178-d6c1990fd25e> in <listcomp>(.0)
----> 1 res = [" ".join(classes[np.where(pp > 0.2)]) for pp in tta[0]]

IndexError: too many indices for array

Now this line is the issue:

res = [" ".join(classes[np.where(pp > 0.2)]) for pp in tta[0]] 

im going to play around with the code and see whats going on

Here is an update, still no resolution so appreciate any solutions.

@ramesh looks like the test_fnames is correctly formatted now but the error is occuring when the labels are being attached.

size = len(data.test_ds.fnames)
size

1000

data.test_ds.fnames

['test-jpg/file_438.jpg',
 'test-jpg/file_253.jpg',
 'test-jpg/file_862.jpg',
 'test-jpg/file_338.jpg',
 'test-jpg/file_840.jpg',
 'test-jpg/file_892.jpg',
 'test-jpg/file_209.jpg',
 'test-jpg/file_890.jpg',
 'test-jpg/file_598.jpg',
 'test-jpg/file_127.jpg',
 'test-jpg/file_639.jpg',
 'test-jpg/file_772.jpg',
 'test-jpg/file_3.jpg',
 'test-jpg/file_666.jpg',
 'test-jpg/file_680.jpg',
 'test-jpg/file_929.jpg',
 'test-jpg/file_830.jpg',
 'test-jpg/file_4.jpg',
 'test-jpg/file_372.jpg',
 'test-jpg/file_152.jpg',
 'test-jpg/file_816.jpg',
 'test-jpg/file_629.jpg',
 'test-jpg/file_849.jpg',
 'test-jpg/file_852.jpg',
 'test-jpg/file_880.jpg',
 'test-jpg/file_647.jpg',
 'test-jpg/file_396.jpg',
 'test-jpg/file_724.jpg',
 'test-jpg/file_420.jpg',
 'test-jpg/file_470.jpg',
 'test-jpg/file_694.jpg',
 'test-jpg/file_774.jpg',
 'test-jpg/file_351.jpg',
 'test-jpg/file_522.jpg',
 'test-jpg/file_754.jpg',
 'test-jpg/file_340.jpg',
 'test-jpg/file_131.jpg',
 'test-jpg/file_792.jpg',
 'test-jpg/file_123.jpg',
 'test-jpg/file_962.jpg',
 'test-jpg/file_14.jpg',
 'test-jpg/file_302.jpg',
 'test-jpg/file_627.jpg',
 'test-jpg/file_776.jpg',
 'test-jpg/file_295.jpg',
 'test-jpg/file_288.jpg',
 'test-jpg/file_486.jpg',
 'test-jpg/file_653.jpg',
 'test-jpg/file_449.jpg',
 'test-jpg/file_845.jpg',
 'test-jpg/file_359.jpg',
 'test-jpg/file_283.jpg',
 'test-jpg/file_562.jpg',
 'test-jpg/file_516.jpg',
 'test-jpg/file_499.jpg',
 'test-jpg/file_52.jpg',
 'test-jpg/file_762.jpg',
 'test-jpg/file_823.jpg',
 'test-jpg/file_971.jpg',
 'test-jpg/file_568.jpg',
 'test-jpg/file_313.jpg',
 'test-jpg/file_836.jpg',
 'test-jpg/file_877.jpg',
 'test-jpg/file_432.jpg',
 'test-jpg/file_859.jpg',
 'test-jpg/file_234.jpg',
 'test-jpg/file_993.jpg',
 'test-jpg/file_341.jpg',
 'test-jpg/file_769.jpg',
 'test-jpg/file_439.jpg',
 'test-jpg/file_151.jpg',
 'test-jpg/file_461.jpg',
 'test-jpg/file_334.jpg',
 'test-jpg/file_386.jpg',
 'test-jpg/file_942.jpg',
 'test-jpg/file_731.jpg',
 'test-jpg/file_255.jpg',
 'test-jpg/file_933.jpg',
 'test-jpg/file_531.jpg',
 'test-jpg/file_858.jpg',
 'test-jpg/file_94.jpg',
 'test-jpg/file_743.jpg',
 'test-jpg/file_786.jpg',
 'test-jpg/file_504.jpg',
 'test-jpg/file_158.jpg',
 'test-jpg/file_975.jpg',
 'test-jpg/file_601.jpg',
 'test-jpg/file_371.jpg',
 'test-jpg/file_577.jpg',
 'test-jpg/file_593.jpg',
 'test-jpg/file_624.jpg',
 'test-jpg/file_206.jpg',
 'test-jpg/file_227.jpg',
 'test-jpg/file_250.jpg',
 'test-jpg/file_654.jpg',
 'test-jpg/file_445.jpg',
 'test-jpg/file_353.jpg',
 'test-jpg/file_838.jpg',
 'test-jpg/file_715.jpg',
 'test-jpg/file_927.jpg',
 'test-jpg/file_24.jpg',
 'test-jpg/file_96.jpg',
 'test-jpg/file_190.jpg',
 'test-jpg/file_330.jpg',
 'test-jpg/file_267.jpg',
 'test-jpg/file_240.jpg',
 'test-jpg/file_619.jpg',
 'test-jpg/file_304.jpg',
 'test-jpg/file_994.jpg',
 'test-jpg/file_974.jpg',
 'test-jpg/file_808.jpg',
 'test-jpg/file_98.jpg',
 'test-jpg/file_86.jpg',
 'test-jpg/file_192.jpg',
 'test-jpg/file_693.jpg',
 'test-jpg/file_242.jpg',
 'test-jpg/file_752.jpg',
 'test-jpg/file_798.jpg',
 'test-jpg/file_784.jpg',
 'test-jpg/file_948.jpg',
 'test-jpg/file_410.jpg',
 'test-jpg/file_907.jpg',
 'test-jpg/file_976.jpg',
 'test-jpg/file_245.jpg',
 'test-jpg/file_63.jpg',
 'test-jpg/file_182.jpg',
 'test-jpg/file_847.jpg',
 'test-jpg/file_99.jpg',
 'test-jpg/file_661.jpg',
 'test-jpg/file_132.jpg',
 'test-jpg/file_902.jpg',
 'test-jpg/file_144.jpg',
 'test-jpg/file_116.jpg',
 'test-jpg/file_706.jpg',
 'test-jpg/file_921.jpg',
 'test-jpg/file_329.jpg',
 'test-jpg/file_679.jpg',
 'test-jpg/file_139.jpg',
 'test-jpg/file_443.jpg',
 'test-jpg/file_951.jpg',
 'test-jpg/file_763.jpg',
 'test-jpg/file_426.jpg',
 'test-jpg/file_178.jpg',
 'test-jpg/file_106.jpg',
 'test-jpg/file_279.jpg',
 'test-jpg/file_853.jpg',
 'test-jpg/file_194.jpg',
 'test-jpg/file_947.jpg',
 'test-jpg/file_1.jpg',
 'test-jpg/file_602.jpg',
 'test-jpg/file_321.jpg',
 'test-jpg/file_57.jpg',
 'test-jpg/file_759.jpg',
 'test-jpg/file_261.jpg',
 'test-jpg/file_806.jpg',
 'test-jpg/file_623.jpg',
 'test-jpg/file_198.jpg',
 'test-jpg/file_918.jpg',
 'test-jpg/file_695.jpg',
 'test-jpg/file_44.jpg',
 'test-jpg/file_136.jpg',
 'test-jpg/file_83.jpg',
 'test-jpg/file_441.jpg',
 'test-jpg/file_518.jpg',
 'test-jpg/file_536.jpg',
 'test-jpg/file_40.jpg',
 'test-jpg/file_554.jpg',
 'test-jpg/file_791.jpg',
 'test-jpg/file_689.jpg',
 'test-jpg/file_686.jpg',
 'test-jpg/file_187.jpg',
 'test-jpg/file_81.jpg',
 'test-jpg/file_180.jpg',
 'test-jpg/file_239.jpg',
 'test-jpg/file_931.jpg',
 'test-jpg/file_233.jpg',
 'test-jpg/file_733.jpg',
 'test-jpg/file_484.jpg',
 'test-jpg/file_662.jpg',
 'test-jpg/file_168.jpg',
 'test-jpg/file_941.jpg',
 'test-jpg/file_238.jpg',
 'test-jpg/file_775.jpg',
 'test-jpg/file_583.jpg',
 'test-jpg/file_6.jpg',
 'test-jpg/file_546.jpg',
 'test-jpg/file_181.jpg',
 'test-jpg/file_935.jpg',
 'test-jpg/file_884.jpg',
 'test-jpg/file_889.jpg',
 'test-jpg/file_744.jpg',
 'test-jpg/file_370.jpg',
 'test-jpg/file_364.jpg',
 'test-jpg/file_268.jpg',
 'test-jpg/file_344.jpg',
 'test-jpg/file_82.jpg',
 'test-jpg/file_510.jpg',
 'test-jpg/file_366.jpg',
 'test-jpg/file_912.jpg',
 'test-jpg/file_712.jpg',
 'test-jpg/file_67.jpg',
 'test-jpg/file_300.jpg',
 'test-jpg/file_559.jpg',
 'test-jpg/file_932.jpg',
 'test-jpg/file_377.jpg',
 'test-jpg/file_452.jpg',
 'test-jpg/file_930.jpg',
 'test-jpg/file_146.jpg',
 'test-jpg/file_997.jpg',
 'test-jpg/file_957.jpg',
 'test-jpg/file_801.jpg',
 'test-jpg/file_739.jpg',
 'test-jpg/file_923.jpg',
 'test-jpg/file_799.jpg',
 'test-jpg/file_205.jpg',
 'test-jpg/file_789.jpg',
 'test-jpg/file_407.jpg',
 'test-jpg/file_571.jpg',
 'test-jpg/file_534.jpg',
 'test-jpg/file_552.jpg',
 'test-jpg/file_262.jpg',
 'test-jpg/file_606.jpg',
 'test-jpg/file_684.jpg',
 'test-jpg/file_821.jpg',
 'test-jpg/file_980.jpg',
 'test-jpg/file_517.jpg',
 'test-jpg/file_489.jpg',
 'test-jpg/file_919.jpg',
 'test-jpg/file_147.jpg',
 'test-jpg/file_811.jpg',
 'test-jpg/file_901.jpg',
 'test-jpg/file_477.jpg',
 'test-jpg/file_632.jpg',
 'test-jpg/file_649.jpg',
 'test-jpg/file_692.jpg',
 'test-jpg/file_972.jpg',
 'test-jpg/file_157.jpg',
 'test-jpg/file_79.jpg',
 'test-jpg/file_809.jpg',
 'test-jpg/file_760.jpg',
 'test-jpg/file_648.jpg',
 'test-jpg/file_451.jpg',
 'test-jpg/file_848.jpg',
 'test-jpg/file_105.jpg',
 'test-jpg/file_813.jpg',
 'test-jpg/file_213.jpg',
 'test-jpg/file_506.jpg',
 'test-jpg/file_254.jpg',
 'test-jpg/file_657.jpg',
 'test-jpg/file_711.jpg',
 'test-jpg/file_332.jpg',
 'test-jpg/file_875.jpg',
 'test-jpg/file_758.jpg',
 'test-jpg/file_729.jpg',
 'test-jpg/file_322.jpg',
 'test-jpg/file_651.jpg',
 'test-jpg/file_55.jpg',
 'test-jpg/file_287.jpg',
 'test-jpg/file_621.jpg',
 'test-jpg/file_285.jpg',
 'test-jpg/file_990.jpg',
 'test-jpg/file_309.jpg',
 'test-jpg/file_275.jpg',
 'test-jpg/file_436.jpg',
 'test-jpg/file_829.jpg',
 'test-jpg/file_538.jpg',
 'test-jpg/file_557.jpg',
 'test-jpg/file_663.jpg',
 'test-jpg/file_690.jpg',
 'test-jpg/file_723.jpg',
 'test-jpg/file_882.jpg',
 'test-jpg/file_75.jpg',
 'test-jpg/file_450.jpg',
 'test-jpg/file_199.jpg',
 'test-jpg/file_128.jpg',
 'test-jpg/file_38.jpg',
 'test-jpg/file_579.jpg',
 'test-jpg/file_751.jpg',
 'test-jpg/file_525.jpg',
 'test-jpg/file_973.jpg',
 'test-jpg/file_277.jpg',
 'test-jpg/file_549.jpg',
 'test-jpg/file_389.jpg',
 'test-jpg/file_362.jpg',
 'test-jpg/file_542.jpg',
 'test-jpg/file_673.jpg',
 'test-jpg/file_331.jpg',
 'test-jpg/file_357.jpg',
 'test-jpg/file_382.jpg',
 'test-jpg/file_381.jpg',
 'test-jpg/file_831.jpg',
 'test-jpg/file_9.jpg',
 'test-jpg/file_435.jpg',
 'test-jpg/file_505.jpg',
 'test-jpg/file_502.jpg',
 'test-jpg/file_211.jpg',
 'test-jpg/file_416.jpg',
 'test-jpg/file_97.jpg',
 'test-jpg/file_289.jpg',
 'test-jpg/file_955.jpg',
 'test-jpg/file_879.jpg',
 'test-jpg/file_306.jpg',
 'test-jpg/file_312.jpg',
 'test-jpg/file_851.jpg',
 'test-jpg/file_582.jpg',
 'test-jpg/file_113.jpg',
 'test-jpg/file_108.jpg',
 'test-jpg/file_735.jpg',
 'test-jpg/file_33.jpg',
 'test-jpg/file_757.jpg',
 'test-jpg/file_850.jpg',
 'test-jpg/file_585.jpg',
 'test-jpg/file_77.jpg',
 'test-jpg/file_78.jpg',
 'test-jpg/file_266.jpg',
 'test-jpg/file_611.jpg',
 'test-jpg/file_135.jpg',
 'test-jpg/file_936.jpg',
 'test-jpg/file_615.jpg',
 'test-jpg/file_899.jpg',
 'test-jpg/file_466.jpg',
 'test-jpg/file_350.jpg',
 'test-jpg/file_906.jpg',
 'test-jpg/file_265.jpg',
 'test-jpg/file_885.jpg',
 'test-jpg/file_23.jpg',
 'test-jpg/file_475.jpg',
 'test-jpg/file_520.jpg',
 'test-jpg/file_764.jpg',
 'test-jpg/file_154.jpg',
 'test-jpg/file_795.jpg',
 'test-jpg/file_174.jpg',
 'test-jpg/file_736.jpg',
 'test-jpg/file_633.jpg',
 'test-jpg/file_229.jpg',
 'test-jpg/file_618.jpg',
 'test-jpg/file_319.jpg',
 'test-jpg/file_732.jpg',
 'test-jpg/file_46.jpg',
 'test-jpg/file_995.jpg',
 'test-jpg/file_43.jpg',
 'test-jpg/file_311.jpg',
 'test-jpg/file_15.jpg',
 'test-jpg/file_922.jpg',
 'test-jpg/file_428.jpg',
 'test-jpg/file_685.jpg',
 'test-jpg/file_984.jpg',
 'test-jpg/file_605.jpg',
 'test-jpg/file_247.jpg',
 'test-jpg/file_403.jpg',
 'test-jpg/file_874.jpg',
 'test-jpg/file_286.jpg',
 'test-jpg/file_68.jpg',
 'test-jpg/file_761.jpg',
 'test-jpg/file_530.jpg',
 'test-jpg/file_716.jpg',
 'test-jpg/file_999.jpg',
 'test-jpg/file_822.jpg',
 'test-jpg/file_22.jpg',
 'test-jpg/file_893.jpg',
 'test-jpg/file_399.jpg',
 'test-jpg/file_160.jpg',
 'test-jpg/file_111.jpg',
 'test-jpg/file_646.jpg',
 'test-jpg/file_292.jpg',
 'test-jpg/file_189.jpg',
 'test-jpg/file_883.jpg',
 'test-jpg/file_897.jpg',
 'test-jpg/file_418.jpg',
 'test-jpg/file_949.jpg',
 'test-jpg/file_1000.jpg',
 'test-jpg/file_614.jpg',
 'test-jpg/file_699.jpg',
 'test-jpg/file_224.jpg',
 'test-jpg/file_318.jpg',
 'test-jpg/file_681.jpg',
 'test-jpg/file_987.jpg',
 'test-jpg/file_934.jpg',
 'test-jpg/file_965.jpg',
 'test-jpg/file_878.jpg',
 'test-jpg/file_672.jpg',
 'test-jpg/file_316.jpg',
 'test-jpg/file_656.jpg',
 'test-jpg/file_600.jpg',
 'test-jpg/file_560.jpg',
 'test-jpg/file_937.jpg',
 'test-jpg/file_954.jpg',
 'test-jpg/file_750.jpg',
 'test-jpg/file_977.jpg',
 'test-jpg/file_996.jpg',
 'test-jpg/file_188.jpg',
 'test-jpg/file_480.jpg',
 'test-jpg/file_431.jpg',
 'test-jpg/file_419.jpg',
 'test-jpg/file_861.jpg',
 'test-jpg/file_697.jpg',
 'test-jpg/file_10.jpg',
 'test-jpg/file_539.jpg',
 'test-jpg/file_32.jpg',
 'test-jpg/file_42.jpg',
 'test-jpg/file_349.jpg',
 'test-jpg/file_391.jpg',
 'test-jpg/file_547.jpg',
 'test-jpg/file_678.jpg',
 'test-jpg/file_219.jpg',
 'test-jpg/file_785.jpg',
 'test-jpg/file_909.jpg',
 'test-jpg/file_609.jpg',
 'test-jpg/file_293.jpg',
 'test-jpg/file_387.jpg',
 'test-jpg/file_717.jpg',
 'test-jpg/file_652.jpg',
 'test-jpg/file_374.jpg',
 'test-jpg/file_323.jpg',
 'test-jpg/file_48.jpg',
 'test-jpg/file_604.jpg',
 'test-jpg/file_448.jpg',
 'test-jpg/file_249.jpg',
 'test-jpg/file_846.jpg',
 'test-jpg/file_345.jpg',
 'test-jpg/file_566.jpg',
 'test-jpg/file_417.jpg',
 'test-jpg/file_834.jpg',
 'test-jpg/file_992.jpg',
 'test-jpg/file_495.jpg',
 'test-jpg/file_780.jpg',
 'test-jpg/file_742.jpg',
 'test-jpg/file_956.jpg',
 'test-jpg/file_630.jpg',
 'test-jpg/file_202.jpg',
 'test-jpg/file_20.jpg',
 'test-jpg/file_119.jpg',
 'test-jpg/file_243.jpg',
 'test-jpg/file_814.jpg',
 'test-jpg/file_938.jpg',
 'test-jpg/file_727.jpg',
 'test-jpg/file_467.jpg',
 'test-jpg/file_37.jpg',
 'test-jpg/file_650.jpg',
 'test-jpg/file_722.jpg',
 'test-jpg/file_476.jpg',
 'test-jpg/file_881.jpg',
 'test-jpg/file_781.jpg',
 'test-jpg/file_80.jpg',
 'test-jpg/file_586.jpg',
 'test-jpg/file_2.jpg',
 'test-jpg/file_440.jpg',
 'test-jpg/file_430.jpg',
 'test-jpg/file_500.jpg',
 'test-jpg/file_405.jpg',
 'test-jpg/file_31.jpg',
 'test-jpg/file_928.jpg',
 'test-jpg/file_471.jpg',
 'test-jpg/file_149.jpg',
 'test-jpg/file_383.jpg',
 'test-jpg/file_982.jpg',
 'test-jpg/file_415.jpg',
 'test-jpg/file_336.jpg',
 'test-jpg/file_802.jpg',
 'test-jpg/file_707.jpg',
 'test-jpg/file_458.jpg',
 'test-jpg/file_655.jpg',
 'test-jpg/file_148.jpg',
 'test-jpg/file_5.jpg',
 'test-jpg/file_167.jpg',
 'test-jpg/file_185.jpg',
 'test-jpg/file_61.jpg',
 'test-jpg/file_305.jpg',
 'test-jpg/file_361.jpg',
 'test-jpg/file_425.jpg',
 'test-jpg/file_888.jpg',
 'test-jpg/file_682.jpg',
 'test-jpg/file_0.jpg',
 'test-jpg/file_462.jpg',
 'test-jpg/file_303.jpg',
 'test-jpg/file_820.jpg',
 'test-jpg/file_564.jpg',
 'test-jpg/file_12.jpg',
 'test-jpg/file_797.jpg',
 'test-jpg/file_184.jpg',
 'test-jpg/file_671.jpg',
 'test-jpg/file_747.jpg',
 'test-jpg/file_668.jpg',
 'test-jpg/file_143.jpg',
 'test-jpg/file_674.jpg',
 'test-jpg/file_827.jpg',
 'test-jpg/file_482.jpg',
 'test-jpg/file_945.jpg',
 'test-jpg/file_833.jpg',
 'test-jpg/file_47.jpg',
 'test-jpg/file_465.jpg',
 'test-jpg/file_356.jpg',
 'test-jpg/file_800.jpg',
 'test-jpg/file_414.jpg',
 'test-jpg/file_454.jpg',
 'test-jpg/file_455.jpg',
 'test-jpg/file_856.jpg',
 'test-jpg/file_524.jpg',
 'test-jpg/file_487.jpg',
 'test-jpg/file_355.jpg',
 'test-jpg/file_498.jpg',
 'test-jpg/file_805.jpg',
 'test-jpg/file_315.jpg',
 'test-jpg/file_257.jpg',
 'test-jpg/file_588.jpg',
 'test-jpg/file_472.jpg',
 'test-jpg/file_150.jpg',
 'test-jpg/file_825.jpg',
 'test-jpg/file_104.jpg',
 'test-jpg/file_28.jpg',
 'test-jpg/file_978.jpg',
 'test-jpg/file_413.jpg',
 'test-jpg/file_691.jpg',
 'test-jpg/file_406.jpg',
 'test-jpg/file_905.jpg',
 'test-jpg/file_85.jpg',
 'test-jpg/file_688.jpg',
 'test-jpg/file_766.jpg',
 'test-jpg/file_429.jpg',
 'test-jpg/file_291.jpg',
 'test-jpg/file_395.jpg',
 'test-jpg/file_161.jpg',
 'test-jpg/file_400.jpg',
 'test-jpg/file_237.jpg',
 'test-jpg/file_714.jpg',
 'test-jpg/file_548.jpg',
 'test-jpg/file_100.jpg',
 'test-jpg/file_898.jpg',
 'test-jpg/file_282.jpg',
 'test-jpg/file_573.jpg',
 'test-jpg/file_865.jpg',
 'test-jpg/file_260.jpg',
 'test-jpg/file_256.jpg',
 'test-jpg/file_95.jpg',
 'test-jpg/file_953.jpg',
 'test-jpg/file_556.jpg',
 'test-jpg/file_434.jpg',
 'test-jpg/file_463.jpg',
 'test-jpg/file_397.jpg',
 'test-jpg/file_126.jpg',
 'test-jpg/file_804.jpg',
 'test-jpg/file_138.jpg',
 'test-jpg/file_442.jpg',
 'test-jpg/file_983.jpg',
 'test-jpg/file_337.jpg',
 'test-jpg/file_71.jpg',
 'test-jpg/file_960.jpg',
 'test-jpg/file_53.jpg',
 'test-jpg/file_497.jpg',
 'test-jpg/file_644.jpg',
 'test-jpg/file_171.jpg',
 'test-jpg/file_550.jpg',
 'test-jpg/file_326.jpg',
 'test-jpg/file_634.jpg',
 'test-jpg/file_963.jpg',
 'test-jpg/file_709.jpg',
 'test-jpg/file_459.jpg',
 'test-jpg/file_125.jpg',
 'test-jpg/file_943.jpg',
 'test-jpg/file_745.jpg',
 'test-jpg/file_335.jpg',
 'test-jpg/file_753.jpg',
 'test-jpg/file_521.jpg',
 'test-jpg/file_342.jpg',
 'test-jpg/file_437.jpg',
 'test-jpg/file_352.jpg',
 'test-jpg/file_488.jpg',
 'test-jpg/file_210.jpg',
 'test-jpg/file_122.jpg',
 'test-jpg/file_327.jpg',
 'test-jpg/file_8.jpg',
 'test-jpg/file_876.jpg',
 'test-jpg/file_276.jpg',
 'test-jpg/file_408.jpg',
 'test-jpg/file_642.jpg',
 'test-jpg/file_926.jpg',
 'test-jpg/file_891.jpg',
 'test-jpg/file_543.jpg',
 'test-jpg/file_218.jpg',
 'test-jpg/file_515.jpg',
 'test-jpg/file_991.jpg',
 'test-jpg/file_153.jpg',
 'test-jpg/file_815.jpg',
 'test-jpg/file_21.jpg',
 'test-jpg/file_675.jpg',
 'test-jpg/file_409.jpg',
 'test-jpg/file_197.jpg',
 'test-jpg/file_110.jpg',
 'test-jpg/file_56.jpg',
 'test-jpg/file_26.jpg',
 'test-jpg/file_494.jpg',
 'test-jpg/file_328.jpg',
 'test-jpg/file_864.jpg',
 'test-jpg/file_423.jpg',
 'test-jpg/file_360.jpg',
 'test-jpg/file_553.jpg',
 'test-jpg/file_871.jpg',
 'test-jpg/file_677.jpg',
 'test-jpg/file_258.jpg',
 'test-jpg/file_118.jpg',
 'test-jpg/file_638.jpg',
 'test-jpg/file_142.jpg',
 'test-jpg/file_528.jpg',
 'test-jpg/file_896.jpg',
 'test-jpg/file_863.jpg',
 'test-jpg/file_710.jpg',
 'test-jpg/file_177.jpg',
 'test-jpg/file_631.jpg',
 'test-jpg/file_392.jpg',
 'test-jpg/file_422.jpg',
 'test-jpg/file_87.jpg',
 'test-jpg/file_636.jpg',
 'test-jpg/file_903.jpg',
 'test-jpg/file_734.jpg',
 'test-jpg/file_155.jpg',
 'test-jpg/file_824.jpg',
 'test-jpg/file_597.jpg',
 'test-jpg/file_481.jpg',
 'test-jpg/file_866.jpg',
 'test-jpg/file_320.jpg',
 'test-jpg/file_837.jpg',
 'test-jpg/file_159.jpg',
 'test-jpg/file_121.jpg',
 'test-jpg/file_165.jpg',
 'test-jpg/file_595.jpg',
 'test-jpg/file_961.jpg',
 'test-jpg/file_200.jpg',
 'test-jpg/file_394.jpg',
 'test-jpg/file_826.jpg',
 'test-jpg/file_748.jpg',
 'test-jpg/file_708.jpg',
 'test-jpg/file_870.jpg',
 'test-jpg/file_365.jpg',
 'test-jpg/file_565.jpg',
 'test-jpg/file_911.jpg',
 'test-jpg/file_622.jpg',
 'test-jpg/file_728.jpg',
 'test-jpg/file_839.jpg',
 'test-jpg/file_421.jpg',
 'test-jpg/file_779.jpg',
 'test-jpg/file_843.jpg',
 'test-jpg/file_917.jpg',
 'test-jpg/file_19.jpg',
 'test-jpg/file_841.jpg',
 'test-jpg/file_667.jpg',
 'test-jpg/file_950.jpg',
 'test-jpg/file_27.jpg',
 'test-jpg/file_664.jpg',
 'test-jpg/file_527.jpg',
 'test-jpg/file_457.jpg',
 'test-jpg/file_842.jpg',
 'test-jpg/file_109.jpg',
 'test-jpg/file_274.jpg',
 'test-jpg/file_88.jpg',
 'test-jpg/file_221.jpg',
 'test-jpg/file_635.jpg',
 'test-jpg/file_756.jpg',
 'test-jpg/file_73.jpg',
 'test-jpg/file_244.jpg',
 'test-jpg/file_223.jpg',
 'test-jpg/file_235.jpg',
 'test-jpg/file_401.jpg',
 'test-jpg/file_794.jpg',
 'test-jpg/file_294.jpg',
 'test-jpg/file_860.jpg',
 'test-jpg/file_913.jpg',
 'test-jpg/file_220.jpg',
 'test-jpg/file_380.jpg',
 'test-jpg/file_867.jpg',
 'test-jpg/file_11.jpg',
 'test-jpg/file_36.jpg',
 'test-jpg/file_433.jpg',
 'test-jpg/file_589.jpg',
 'test-jpg/file_958.jpg',
 'test-jpg/file_854.jpg',
 'test-jpg/file_225.jpg',
 'test-jpg/file_660.jpg',
 'test-jpg/file_868.jpg',
 'test-jpg/file_895.jpg',
 'test-jpg/file_298.jpg',
 'test-jpg/file_492.jpg',
 'test-jpg/file_914.jpg',
 'test-jpg/file_594.jpg',
 'test-jpg/file_101.jpg',
 'test-jpg/file_944.jpg',
 'test-jpg/file_509.jpg',
 'test-jpg/file_616.jpg',
 'test-jpg/file_208.jpg',
 'test-jpg/file_358.jpg',
 'test-jpg/file_563.jpg',
 'test-jpg/file_411.jpg',
 'test-jpg/file_613.jpg',
 'test-jpg/file_217.jpg',
 'test-jpg/file_544.jpg',
 'test-jpg/file_920.jpg',
 'test-jpg/file_964.jpg',
 'test-jpg/file_755.jpg',
 'test-jpg/file_701.jpg',
 'test-jpg/file_363.jpg',
 'test-jpg/file_869.jpg',
 'test-jpg/file_493.jpg',
 'test-jpg/file_703.jpg',
 'test-jpg/file_720.jpg',
 'test-jpg/file_835.jpg',
 'test-jpg/file_259.jpg',
 'test-jpg/file_51.jpg',
 'test-jpg/file_179.jpg',
 'test-jpg/file_610.jpg',
 'test-jpg/file_485.jpg',
 'test-jpg/file_872.jpg',
 'test-jpg/file_533.jpg',
 'test-jpg/file_925.jpg',
 'test-jpg/file_368.jpg',
 'test-jpg/file_201.jpg',
 'test-jpg/file_592.jpg',
 'test-jpg/file_456.jpg',
 'test-jpg/file_231.jpg',
 'test-jpg/file_367.jpg',
 'test-jpg/file_979.jpg',
 'test-jpg/file_777.jpg',
 'test-jpg/file_25.jpg',
 'test-jpg/file_343.jpg',
 'test-jpg/file_561.jpg',
 'test-jpg/file_641.jpg',
 'test-jpg/file_718.jpg',
 'test-jpg/file_793.jpg',
 'test-jpg/file_696.jpg',
 'test-jpg/file_670.jpg',
 'test-jpg/file_479.jpg',
 'test-jpg/file_900.jpg',
 'test-jpg/file_584.jpg',
 'test-jpg/file_54.jpg',
 'test-jpg/file_290.jpg',
 'test-jpg/file_404.jpg',
 'test-jpg/file_281.jpg',
 'test-jpg/file_65.jpg',
 'test-jpg/file_726.jpg',
 'test-jpg/file_857.jpg',
 'test-jpg/file_16.jpg',
 'test-jpg/file_241.jpg',
 'test-jpg/file_424.jpg',
 'test-jpg/file_970.jpg',
 'test-jpg/file_989.jpg',
 'test-jpg/file_496.jpg',
 'test-jpg/file_272.jpg',
 'test-jpg/file_269.jpg',
 'test-jpg/file_765.jpg',
 'test-jpg/file_444.jpg',
 'test-jpg/file_908.jpg',
 'test-jpg/file_89.jpg',
 'test-jpg/file_555.jpg',
 'test-jpg/file_612.jpg',
 'test-jpg/file_683.jpg',
 'test-jpg/file_446.jpg',
 'test-jpg/file_226.jpg',
 'test-jpg/file_569.jpg',
 'test-jpg/file_236.jpg',
 'test-jpg/file_818.jpg',
 'test-jpg/file_102.jpg',
 'test-jpg/file_773.jpg',
 'test-jpg/file_117.jpg',
 'test-jpg/file_62.jpg',
 'test-jpg/file_570.jpg',
 'test-jpg/file_669.jpg',
 'test-jpg/file_988.jpg',
 'test-jpg/file_41.jpg',
 'test-jpg/file_469.jpg',
 'test-jpg/file_575.jpg',
 'test-jpg/file_628.jpg',
 'test-jpg/file_490.jpg',
 'test-jpg/file_246.jpg',
 'test-jpg/file_540.jpg',
 'test-jpg/file_191.jpg',
 'test-jpg/file_873.jpg',
 'test-jpg/file_280.jpg',
 'test-jpg/file_545.jpg',
 'test-jpg/file_501.jpg',
 'test-jpg/file_271.jpg',
 'test-jpg/file_134.jpg',
 'test-jpg/file_468.jpg',
 'test-jpg/file_770.jpg',
 'test-jpg/file_810.jpg',
 'test-jpg/file_581.jpg',
 'test-jpg/file_640.jpg',
 'test-jpg/file_166.jpg',
 'test-jpg/file_314.jpg',
 'test-jpg/file_133.jpg',
 'test-jpg/file_828.jpg',
 'test-jpg/file_966.jpg',
 'test-jpg/file_183.jpg',
 'test-jpg/file_76.jpg',
 'test-jpg/file_676.jpg',
 'test-jpg/file_120.jpg',
 'test-jpg/file_92.jpg',
 'test-jpg/file_91.jpg',
 'test-jpg/file_460.jpg',
 'test-jpg/file_103.jpg',
 'test-jpg/file_526.jpg',
 'test-jpg/file_34.jpg',
 'test-jpg/file_713.jpg',
 'test-jpg/file_215.jpg',
 'test-jpg/file_169.jpg',
 'test-jpg/file_252.jpg',
 'test-jpg/file_347.jpg',
 'test-jpg/file_193.jpg',
 'test-jpg/file_248.jpg',
 'test-jpg/file_968.jpg',
 'test-jpg/file_369.jpg',
 'test-jpg/file_946.jpg',
 'test-jpg/file_112.jpg',
 'test-jpg/file_981.jpg',
 'test-jpg/file_141.jpg',
 'test-jpg/file_74.jpg',
 'test-jpg/file_474.jpg',
 'test-jpg/file_29.jpg',
 'test-jpg/file_904.jpg',
 'test-jpg/file_317.jpg',
 'test-jpg/file_782.jpg',
 'test-jpg/file_514.jpg',
 'test-jpg/file_301.jpg',
 'test-jpg/file_376.jpg',
 'test-jpg/file_607.jpg',
 'test-jpg/file_796.jpg',
 'test-jpg/file_741.jpg',
 'test-jpg/file_737.jpg',
 'test-jpg/file_969.jpg',
 'test-jpg/file_175.jpg',
 'test-jpg/file_537.jpg',
 'test-jpg/file_114.jpg',
 'test-jpg/file_115.jpg',
 'test-jpg/file_348.jpg',
 'test-jpg/file_207.jpg',
 'test-jpg/file_263.jpg',
 'test-jpg/file_402.jpg',
 'test-jpg/file_599.jpg',
 'test-jpg/file_503.jpg',
 'test-jpg/file_812.jpg',
 'test-jpg/file_162.jpg',
 'test-jpg/file_69.jpg',
 'test-jpg/file_59.jpg',
 'test-jpg/file_296.jpg',
 'test-jpg/file_721.jpg',
 'test-jpg/file_264.jpg',
 'test-jpg/file_768.jpg',
 'test-jpg/file_273.jpg',
 'test-jpg/file_507.jpg',
 'test-jpg/file_529.jpg',
 'test-jpg/file_704.jpg',
 'test-jpg/file_333.jpg',
 'test-jpg/file_70.jpg',
 'test-jpg/file_64.jpg',
 'test-jpg/file_66.jpg',
 'test-jpg/file_519.jpg',
 'test-jpg/file_324.jpg',
 'test-jpg/file_771.jpg',
 'test-jpg/file_173.jpg',
 'test-jpg/file_807.jpg',
 'test-jpg/file_725.jpg',
 'test-jpg/file_186.jpg',
 'test-jpg/file_129.jpg',
 'test-jpg/file_373.jpg',
 'test-jpg/file_17.jpg',
 'test-jpg/file_508.jpg',
 'test-jpg/file_730.jpg',
 'test-jpg/file_378.jpg',
 'test-jpg/file_778.jpg',
 'test-jpg/file_473.jpg',
 'test-jpg/file_558.jpg',
 'test-jpg/file_551.jpg',
 'test-jpg/file_297.jpg',
 'test-jpg/file_787.jpg',
 'test-jpg/file_308.jpg',
 'test-jpg/file_228.jpg',
 'test-jpg/file_140.jpg',
 'test-jpg/file_523.jpg',
 'test-jpg/file_284.jpg',
 'test-jpg/file_164.jpg',
 'test-jpg/file_50.jpg',
 'test-jpg/file_591.jpg',
 'test-jpg/file_145.jpg',
 'test-jpg/file_7.jpg',
 'test-jpg/file_384.jpg',
 'test-jpg/file_746.jpg',
 'test-jpg/file_910.jpg',
 'test-jpg/file_49.jpg',
 'test-jpg/file_959.jpg',
 'test-jpg/file_478.jpg',
 'test-jpg/file_643.jpg',
 'test-jpg/file_916.jpg',
 'test-jpg/file_596.jpg',
 'test-jpg/file_163.jpg',
 'test-jpg/file_412.jpg',
 'test-jpg/file_398.jpg',
 'test-jpg/file_307.jpg',
 'test-jpg/file_886.jpg',
 'test-jpg/file_325.jpg',
 'test-jpg/file_535.jpg',
 'test-jpg/file_817.jpg',
 'test-jpg/file_924.jpg',
 'test-jpg/file_390.jpg',
 'test-jpg/file_447.jpg',
 'test-jpg/file_393.jpg',
 'test-jpg/file_45.jpg',
 'test-jpg/file_222.jpg',
 'test-jpg/file_719.jpg',
 'test-jpg/file_608.jpg',
 'test-jpg/file_196.jpg',
 'test-jpg/file_35.jpg',
 'test-jpg/file_172.jpg',
 'test-jpg/file_270.jpg',
 'test-jpg/file_832.jpg',
 'test-jpg/file_986.jpg',
 'test-jpg/file_137.jpg',
 'test-jpg/file_738.jpg',
 'test-jpg/file_232.jpg',
 'test-jpg/file_939.jpg',
 'test-jpg/file_230.jpg',
 'test-jpg/file_375.jpg',
 'test-jpg/file_617.jpg',
 'test-jpg/file_587.jpg',
 'test-jpg/file_427.jpg',
 'test-jpg/file_665.jpg',
 'test-jpg/file_767.jpg',
 'test-jpg/file_687.jpg',
 'test-jpg/file_819.jpg',
 'test-jpg/file_855.jpg',
 'test-jpg/file_790.jpg',
 'test-jpg/file_915.jpg',
 'test-jpg/file_658.jpg',
 'test-jpg/file_453.jpg',
 'test-jpg/file_844.jpg',
 'test-jpg/file_532.jpg',
 'test-jpg/file_698.jpg',
 'test-jpg/file_620.jpg',
 'test-jpg/file_18.jpg',
 'test-jpg/file_216.jpg',
 'test-jpg/file_346.jpg',
 'test-jpg/file_212.jpg',
 'test-jpg/file_659.jpg',
 'test-jpg/file_90.jpg',
 'test-jpg/file_464.jpg',
 'test-jpg/file_590.jpg',
 'test-jpg/file_512.jpg',
 'test-jpg/file_998.jpg',
 'test-jpg/file_580.jpg',
 'test-jpg/file_740.jpg',
 'test-jpg/file_93.jpg',
 'test-jpg/file_625.jpg',
 'test-jpg/file_60.jpg',
 'test-jpg/file_39.jpg',
 'test-jpg/file_385.jpg',
 'test-jpg/file_578.jpg',
 'test-jpg/file_702.jpg',
 'test-jpg/file_940.jpg',
 'test-jpg/file_310.jpg',
 'test-jpg/file_299.jpg',
 'test-jpg/file_574.jpg',
 'test-jpg/file_513.jpg',
 'test-jpg/file_379.jpg',
 'test-jpg/file_572.jpg',
 'test-jpg/file_626.jpg',
 'test-jpg/file_894.jpg',
 'test-jpg/file_705.jpg',
 'test-jpg/file_251.jpg',
 'test-jpg/file_783.jpg',
 'test-jpg/file_339.jpg',
 'test-jpg/file_72.jpg',
 'test-jpg/file_124.jpg',
 'test-jpg/file_967.jpg',
 'test-jpg/file_749.jpg',
 'test-jpg/file_603.jpg',
 'test-jpg/file_541.jpg',
 'test-jpg/file_13.jpg',
 'test-jpg/file_511.jpg',
 'test-jpg/file_130.jpg',
 'test-jpg/file_214.jpg',
 'test-jpg/file_176.jpg',
 'test-jpg/file_58.jpg',
 'test-jpg/file_84.jpg',
 'test-jpg/file_887.jpg',
 'test-jpg/file_156.jpg',
 'test-jpg/file_195.jpg',
 'test-jpg/file_203.jpg',
 'test-jpg/file_388.jpg',
 'test-jpg/file_107.jpg',
 'test-jpg/file_985.jpg',
 'test-jpg/file_645.jpg',
 'test-jpg/file_952.jpg',
 'test-jpg/file_204.jpg',
 'test-jpg/file_637.jpg',
 'test-jpg/file_30.jpg',
 'test-jpg/file_700.jpg',
 'test-jpg/file_491.jpg',
 'test-jpg/file_803.jpg',
 'test-jpg/file_354.jpg',
 'test-jpg/file_170.jpg',
 'test-jpg/file_567.jpg',
 'test-jpg/file_278.jpg',
 'test-jpg/file_788.jpg',
 'test-jpg/file_576.jpg']

classes = np.array(data.classes, dtype=str)

classes

array(['agriculture', 'artisinal_mine', 'bare_ground', 'blooming', 'blow_down', 'clear', 'cloudy', 'conventional_mine', 'cultivation', 'habitation', 'haze', 'partly_cloudy', 'primary', 'road', 'selective_logging', 'slash_burn', 'water'], dtype='<U17'

res = [" ".join(classes[np.where(pp > 0.2)]) for pp in tta[0]]

IndexError                                Traceback (most recent call last)
<ipython-input-76-d6c1990fd25e> in <module>()
----> 1 res = [" ".join(classes[np.where(pp > 0.2)]) for pp in tta[0]]

<ipython-input-76-d6c1990fd25e> in <listcomp>(.0)
----> 1 res = [" ".join(classes[np.where(pp > 0.2)]) for pp in tta[0]]

IndexError: too many indices for array

@amritv - The problem could be you are indexing into the Classes Array with a 2-D index, when it’s a 1-D numpy array. You might want to do this -

for pp in tta[0]:
    print(pp)
    break
See what pp gets printed as.
2 Likes

This is what it prints out:

for pp in tta[0]: print(pp) break

[[ 0.50097  0.00066  0.01985 ...,  0.00858  0.00963  0.02658]
 [ 0.41878  0.00163  0.0276  ...,  0.04133  0.04407  0.0143 ]
 [ 0.64342  0.00021  0.00377 ...,  0.00241  0.00116  0.12365]
 ..., 
 [ 0.02361  0.00004  0.00034 ...,  0.00072  0.00016  0.00211]
 [ 0.00056  0.       0.      ...,  0.       0.       0.00021]
 [ 0.68849  0.0002   0.00359 ...,  0.00557  0.00179  0.21535]]

So as you can see you can’t index this 2-D Array that you will get when you do np.where(pp > 0.2) into the 1-D classes. What you need is a Double For loop. I suspect…something like this -

res = [" ".join(classes[np.where(p > 0.2)]) for pp in tta[0] for p in pp]

You may need to modify this depending on what you need for submission. I am sure there are some good references here, but if you need res as a 2-D array, you could wrap the join result in an array like -

res = [[" ".join(classes[np.where(p > 0.2)])] for pp in tta[0] for p in pp]

Please double check my suggestions here…It’s been a while since I did anything this this specific problem.

3 Likes

Really appreciate your help and will report back on the outcomes cheers :grinning:

That worked! but the drama keeps going on lol.

So your code worked but there is still the following error:

submission.insert(0, 'image_name', test_fnames)

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-270-b3ff6658a8f4> in <module>()
----> 1 submission.insert(0, 'image_name', test_fnames)

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/pandas/core/frame.py in insert(self, loc, column, value, allow_duplicates)
   2609         """
   2610         self._ensure_valid_index(value)
-> 2611         value = self._sanitize_column(column, value, broadcast=False)
   2612         self._data.insert(loc, column, value,
   2613                           allow_duplicates=allow_duplicates)

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/pandas/core/frame.py in _sanitize_column(self, key, value, broadcast)
   2758 
   2759             # turn me into an ndarray
-> 2760             value = _sanitize_index(value, self.index, copy=False)
   2761             if not isinstance(value, (np.ndarray, Index)):
   2762                 if isinstance(value, list) and len(value) > 0:

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/pandas/core/series.py in _sanitize_index(data, index, copy)
   3119 
   3120     if len(data) != len(index):
-> 3121         raise ValueError('Length of values does not match length of ' 'index')
   3122 
   3123     if isinstance(data, PeriodIndex):

ValueError: Length of values does not match length of index

I figured out that the index file is 1000 long but the values file is 5000 long.

[                                                   tags
 0                                   clear primary water
 1                                         clear primary
 2                                 partly_cloudy primary
 3                                                cloudy
 4                                         clear primary
 5                                         clear primary
 6                                         clear primary
 7                                   clear primary water
 8                                   clear primary water
 9     artisinal_mine bare_ground clear primary road ...
 10                                  clear primary water
 11                                   clear haze primary
 12                                        clear primary
 13                                          clear water
 14                          clear partly_cloudy primary
 15                                        clear primary
 16                                          cloudy haze
 17                                partly_cloudy primary
 18           agriculture clear cultivation primary road
 19                                        clear primary
 20                                        clear primary
 21                                        clear primary
 22                                   clear haze primary
 23                       clear cultivation haze primary
 24            agriculture clear habitation primary road
 25                                        clear primary
 26                                        clear primary
 27                                  clear primary water
 28                                               cloudy
 29                                          clear water
 ...                                                 ...
 4970                          agriculture clear primary
 4971                                      clear primary
 4972                                      clear primary
 4973                                        cloudy haze
 4974                                 clear cloudy water
 4975                              partly_cloudy primary
 4976                                clear primary water
 4977                     agriculture clear primary road
 4978                          agriculture clear primary
 4979          agriculture clear habitation primary road
 4980                                             cloudy
 4981                                      clear primary
 4982                                      clear primary
 4983                          agriculture clear primary
 4984                                      clear primary
 4985                                      clear primary
 4986          agriculture clear habitation primary road
 4987                                      clear primary
 4988                                clear primary water
 4989          agriculture clear habitation primary road
 4990                                      clear primary
 4991                                      clear primary
 4992                                      clear primary
 4993                    clear cultivation primary water
 4994          agriculture clear habitation primary road
 4995                                             cloudy
 4996                          agriculture clear primary
 4997                                      clear primary
 4998                                      clear primary
 4999                              partly_cloudy primary
 
 [5000 rows x 1 columns]

i used this code to help but still no luck

import resource
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (1000, rlimit[1]))