Ssd.pytorch: NameError: name 'viz' is not defined

Created on 5 May 2019  路  2Comments  路  Source: amdegroot/ssd.pytorch

Most helpful comment

I solved this by moving the following statements to the top, with other import statements.

import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.utils.data as data
import numpy as np
import argparse
import visdom

viz = visdom.Visdom()

All 2 comments

I solved this by moving the following statements to the top, with other import statements.

import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.utils.data as data
import numpy as np
import argparse
import visdom

viz = visdom.Visdom()

I solved this by moving the following statements to the top, with other import statements.

import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.utils.data as data
import numpy as np
import argparse
import visdom

viz = visdom.Visdom()

YES!! Worked like below:

import ...

parser.add_argument()
...

args = parser.parse_args()

if args.visdom:
    import visdom
    viz = visdom.Visdom()
Was this page helpful?
0 / 5 - 0 ratings