parser.add_argument('--gpu-index', type=int, default=0, metavar='N')
args = parser.parse_args()
device = torch.device('cuda', index=args.gpu_index) if torch.cuda.is_available() else torch.device('cpu')
if torch.cuda.is_available():
torch.cuda.set_device(args.gpu_index)
np.random.seed(args.seed)
torch.manual_seed(args.seed)
env.seed(args.seed)
from progress.bar import IncrementalBar
mylist = [1, 2, 3, 4, 5, 6, 7, 8]
bar = IncrementalBar('Countdown', max=len(mylist))
for item in mylist:
bar.next()
time.sleep(1)
bar.finish()