在运行代码的过程中遇到报错:
AttributeError: 'NoneType' object has no attribute 'seed'
报错部分代码:
def options():
parser = argparse.ArgumentParser(description='tpccNet: A Fully-Convolutional Network For Inlier Estimation (Training)')
parser.add_argument('--exp_name', type=str, default='exp_tpccnet', metavar='N',
help='Name of the experiment')
# settings for on training
parser.add_argument('--seed', type=int, default=1234)
args = parser.parse_args()
return args
def main():
args = options()
torch.backends.cudnn.deterministic = True
torch.manual_seed(args.seed) #此处报错
torch.cuda.manual_seed_all(args.seed)
np.random.seed(args.seed)
boardio = SummaryWriter(log_dir='checkpoints/' + args.exp_name)
_init_(args)
textio = IOStream('checkpoints/' + args.exp_name + '/run.log')
textio.cprint(str(args))
请问是什么原因呢?有没有什么解决方法?
谢谢!