Thank you very much!When’print(type(input))’,the line shows :type(input) <type(input) <class ‘list’>
The code rising this error:
for batch_idx,(input, target) in enumerate(loader):
# Create vaiables
if torch.cuda.is_available():
print(‘type(input)’,type(input))
input = input.cuda()
The error message is :Traceback (most recent call last):
File “C:\Users\hp\Downloads\efficient_densenet_pytorch-master\demoEmotion.py”, line 323, in 
fire.Fire(demo)
File “C:\Users\hp\Anaconda3\envs\tf-gpu\lib\site-packages\fire\core.py”, line 138, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File “C:\Users\hp\Anaconda3\envs\tf-gpu\lib\site-packages\fire\core.py”, line 468, in _Fire
target=component.name)
File “C:\Users\hp\Anaconda3\envs\tf-gpu\lib\site-packages\fire\core.py”, line 672, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File “C:\Users\hp\Downloads\efficient_densenet_pytorch-master\demoEmotion.py”, line 301, in demo
n_epochs=n_epochs, batch_size=batch_size, seed=seed)
File “C:\Users\hp\Downloads\efficient_densenet_pytorch-master\demoEmotion.py”, line 180, in train
n_epochs=n_epochs,
File “C:\Users\hp\Downloads\efficient_densenet_pytorch-master\demoEmotion.py”, line 56, in train_epoch
input = input.cuda()
AttributeError: ‘list’ object has no attribute ‘cuda’
Now when I run again,list object has no ‘cuda’. Please answer!Thanks a lot in advance!