AttributeError: 'GlobalStorage' object has no attribute 'float'

Hello, I am trying to run my GCN on image dataset. I have used dataloader and this is the following output of the data loader

Below is my code for my model and my training of my data:
class GCNN(torch.nn.Module):
def init(self):
super().init()
self.conv1 = GCNConv(face_dataset.num_node_features, 100)
self.conv2 = GCNConv(100, face_dataset.landmarks_len)

def forward(self, data):
    x, edge_index = data.x, data.edge_index

    x = self.conv1(x, edge_index)
    x = F.relu(x)
    x = F.dropout(x, training=self.training)
    x = self.conv2(x, edge_index)

    return x

dataloader = DataLoader(face_dataset, batch_size=4,
shuffle=True)

model = GCNN()
optimizer = torch.optim.Adam(model.parameters(), lr=0.01, weight_decay=5e-4)
log_interval = 1
num_epoch = 5

def train(epoch):
model.train()
for batch_idx, (data, target) in enumerate(dataloader):
optimizer.zero_grad()
output = model(data)
print(output)
print(target)
loss = F.nll_loss(output, target)
loss.backward()
optimizer.step()
if batch_idx % log_interval == 0:
print(‘Train Epoch: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}’.format(
epoch, batch_idx * len(data), len(dataloader.dataset),
100. * batch_idx / len(dataloader), loss.item()))

for i in range(0, num_epoch):
train(i)

I am getting the below error:

RuntimeError Traceback (most recent call last)
in
109
110 for i in range(0, num_epoch):
→ 111 train(i)

in train(epoch)
96 for batch_idx, (data, target) in enumerate(dataloader):
97 optimizer.zero_grad()
—> 98 output = model(data)
99 print(output)
100 print(target)

~\anaconda3\envs\keerthi\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)
887 result = self._slow_forward(*input, **kwargs)
888 else:
→ 889 result = self.forward(*input, **kwargs)
890 for hook in itertools.chain(
891 _global_forward_hooks.values(),

in forward(self, data)
75 x, edge_index = data.x, data.edge_index
76
—> 77 x = self.conv1(x, edge_index)
78 x = F.relu(x)
79 x = F.dropout(x, training=self.training)

~\anaconda3\envs\keerthi\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)
887 result = self._slow_forward(*input, **kwargs)
888 else:
→ 889 result = self.forward(*input, **kwargs)
890 for hook in itertools.chain(
891 _global_forward_hooks.values(),

~\anaconda3\envs\keerthi\lib\site-packages\torch_geometric\nn\conv\gcn_conv.py in forward(self, x, edge_index, edge_weight)
180 edge_index = cache
181
→ 182 x = self.lin(x)
183
184 # propagate_type: (x: Tensor, edge_weight: OptTensor)

~\anaconda3\envs\keerthi\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)
887 result = self._slow_forward(*input, **kwargs)
888 else:
→ 889 result = self.forward(*input, **kwargs)
890 for hook in itertools.chain(
891 _global_forward_hooks.values(),

~\anaconda3\envs\keerthi\lib\site-packages\torch_geometric\nn\dense\linear.py in forward(self, x)
107 def forward(self, x: Tensor) → Tensor:
108 “”“”“”
→ 109 return F.linear(x, self.weight, self.bias)
110
111 @torch.no_grad()

~\anaconda3\envs\keerthi\lib\site-packages\torch\nn\functional.py in linear(input, weight, bias)
1751 if has_torch_function_variadic(input, weight):
1752 return handle_torch_function(linear, (input, weight), input, weight, bias=bias)
→ 1753 return torch._C._nn.linear(input, weight, bias)
1754
1755

RuntimeError: expected scalar type Byte but found Float

and then i changed my output to:
output = model(data.float())

but then i am getting the below error:

KeyError Traceback (most recent call last)
~\anaconda3\envs\keerthi\lib\site-packages\torch_geometric\data\storage.py in getattr(self, key)
47 try:
—> 48 return self[key]
49 except KeyError:

~\anaconda3\envs\keerthi\lib\site-packages\torch_geometric\data\storage.py in getitem(self, key)
67 def getitem(self, key: str) → Any:
—> 68 return self._mapping[key]
69

KeyError: ‘float’

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last)
in
1 for i in range(0, num_epoch):
----> 2 train(i)

in train(epoch)
3 for batch_idx, (data, target) in enumerate(dataloader):
4 optimizer.zero_grad()
----> 5 output = model(data.float())
6 print(output)
7 print(target)

~\anaconda3\envs\keerthi\lib\site-packages\torch_geometric\data\data.py in getattr(self, key)
360 "dataset, remove the ‘processed/’ directory in the dataset’s "
361 “root folder and try again.”)
→ 362 return getattr(self._store, key)
363
364 def setattr(self, key: str, value: Any):

~\anaconda3\envs\keerthi\lib\site-packages\torch_geometric\data\storage.py in getattr(self, key)
49 except KeyError:
50 raise AttributeError(
—> 51 f"‘{self.class.name}’ object has no attribute ‘{key}’")
52
53 def setattr(self, key: str, value: Any):

AttributeError: ‘GlobalStorage’ object has no attribute ‘float’
can anyone please tell me how to fix this?