Ray lightning train

Trying to get the example code for Ray and PyTorch lightning integration and it fails on my local MacBook, I get a weird error saying F not found.

Any ideas?

Snippet of the error: File “/Users/rganti/Research/HybridCloud/rayenv/lib/python3.7/site-packages/pytorch_lightning/overrides/base.py”, line 81, in forward
output = self.module.training_step(*inputs, **kwargs)
File “”, line 33, in training_step
File “”, line 25, in forward
NameError: name ‘F’ is not defined

2022-02-02 21:44:59,014 ERROR worker.py:85 – Unhandled error (suppress with RAY_IGNORE_UNHANDLED_ERRORS=1): ray::RayExecutor.execute() (pid=53181, ip=, repr=<ray_lightning.ray_ddp.RayExecutor object at 0x7fea08154f10>)
File “/Users/rganti/Research/HybridCloud/rayenv/lib/python3.7/site-packages/ray_lightning/ray_ddp.py”, line 62, in execute
return fn(*args, **kwargs)

Did you import F from torch functional?

@raghukiran which example is this? Just to make sure you do have this line in the code, right? import torch.nn.functional as F

oh weird, I had put the medium link and it got lost: Getting Started With Ray Lightning: Easy Multi-Node PyTorch Lightning Training | by Michael Galarnyk | PyTorch | Medium ; let me try the F import

works! Thanks guys… appreciate your prompt response :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.