question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14

github_iconTop GitHub Comments

2reactions
zyhhhycommented, Sep 4, 2020

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.

0reactions
Linda-Lcommented, Apr 20, 2021

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")

img = show_result(model, img, result, palette=palette, show=False,out_file=“./test_output/”+img_name+“.png”)

hi,but I don’t have this function show_result

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plotting in a non-blocking way with Matplotlib - Stack Overflow
For my specific project I'm plotting images, but you can use plot() ... Meanwhile, this warning can be suppressed, and the future behavior ......
Read more >
Source code for mmseg.models.segmentors.base
All rights reserved. import warnings from abc import ABCMeta, ... if not (show or out_file): warnings.warn('show==False and out_file is not specified, only ......
Read more >
obspy.core.inventory.network — ObsPy 1.3.0 documentation
(This might happen if the user only wants a document that goes contains only ... warnings.warn(msg) elif len(responses) < 1: msg = "No...
Read more >
mmocr/models/kie/extractors/sdmgr.py - tomofi - Hugging Face
import warnings. import mmcv ... If None, class index will be shown in ... warnings.warn('show==False and out_file is not specified, only '.
Read more >
obspy.core.inventory.response._adjust_bode_plot_figure Example
If not specified, a new figure is opened. ... plot_degrees=plot_degrees, show=False, outfile=None) except ZeroSamplingRate: msg = ("Skipping plot of channel ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found