Skip to content

Commit 8ab5913

Browse files
committed
- fix bug
1 parent 6ad065f commit 8ab5913

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ISAT/segment_any/gpu_resource.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ def __init__(self):
3333

3434
def run(self):
3535
while True:
36-
r = os.popen('{} Used'.format(self.command)).readline()
37-
used = r.split(':')[-1].strip().split(' ')[0]
38-
self.message.emit("cuda: {}/{}MiB".format(used, self.total))
36+
try:
37+
r = os.popen('{} Used'.format(self.command)).readline()
38+
used = r.split(':')[-1].strip().split(' ')[0]
39+
self.message.emit("cuda: {}/{}MiB".format(used, self.total))
40+
except:
41+
self.message.emit("cuda: {}/{}MiB".format('-', '-'))
3942

4043
def __del__(self):
4144
self.message.emit("Ground filter thread | Wait for thread to exit.")

0 commit comments

Comments
 (0)