mmsegmentation: warnings.warn('show==False and out_file is not specified, only '

When I have my environment configured and ready to run demo times, I make an error Is it because the output file is not specified?If I need to specify the output file, where do I modify it Execute the command: python demo/image_demo.py demo/demo.png configs/deeplabv3/deeplabv3_r50-d8_512x1024_40k_cityscapes.py checkpoints/deeplabv3_r50-d8_512x1024_40k_cityscapes_20200605_022449-acadc2f8.pth --device cuda:0 --palette cityscapes Error: which: no hipcc in (/EDA/soft/anaconda3.7/bin:/EDA/soft/anaconda3.7/condabin:/usr/lib64/qt-3.3/bin:/home/zuochang2/perl5/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/var/lib/snapd/snap/bin:/home/zuochang2/.local/bin:/home/zuochang2/bin) /EDA/soft/anaconda3.7/lib/python3.7/site-packages/mmseg/models/segmentors/base.py:265: UserWarning: show==False and out_file is not specified, only result image will be returned warnings.warn('show==False and out_file is not specified, only ’

Reproduction

  1. What command or script did you run?
A placeholder for the command.
  1. Did you make any modifications on the code or config? Did you understand what you have modified?
  2. What dataset did you use?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15

Commits related to this issue

Most upvoted comments

Oh, I can give you another advice, which is the method i am using. Modify the show_result_pyplot function like this:

def show_result_pyplot(model, img, result, palette=None, fig_size=(15, 10)):
    if hasattr(model, 'module'):
        model = model.module
    img_name=img.split("/")[-1].split(".")[0]
    print(img_name+" DONE!")
    img = show_result(model,img, result, palette=palette, show=False,out_file="./test_output/"+img_name+".png")
    # plt.figure(figsize=fig_size)
    # plt.imshow(mmcv.bgr2rgb(img))
    # plt.savefig('./test_output/'+img_name+'.png')
    # plt.show()
    # plt.close('all')

PS:

  1. You are expected to create the “test_output” folder FIRST in your working dir.
  2. The warnings disappeared and I got the right image in the “test_output” folder.
  3. You can copy the show_result_pyplot function to image_demo.py for easy debug.
  4. show_result function is in mmseg\models\segmentors\base.py

Hope this can help you fix the problems.