TyXe-BDL / TyXe

MIT License
145 stars 33 forks source link

DGL deprecation warnings #19

Open icfly2 opened 2 years ago

icfly2 commented 2 years ago

deprecation warnings need to be addressed.

    features = torch.FloatTensor(data.features)
    labels = torch.LongTensor(data.labels)
    train_mask = torch.BoolTensor(data.train_mask)
    test_mask = torch.BoolTensor(data.test_mask)
    val_mask = torch.BoolTensor(data.val_mask)
    g = dgl.from_networkx(data.graph)

I'll make a PR after pyro upgrade

hpplyt commented 2 years ago

I also noticed some torchvision deprecation warnings in resnet.py example.

icfly2 commented 2 years ago

From what I can find, they are all in torchvision though, so that should be addressed there.

(env) rum@neu-aa-devmachine-gpu-1:~/TyXe/examples$ python -W once::DeprecationWarning resnet.py --inference mean-field --num-epochs 10
/home/rum/env/lib/python3.8/site-packages/torchvision/transforms/functional_pil.py:228: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
  interpolation: int = Image.BILINEAR,
/home/rum/env/lib/python3.8/site-packages/torchvision/transforms/functional_pil.py:295: DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead.
  interpolation: int = Image.NEAREST,
/home/rum/env/lib/python3.8/site-packages/torchvision/transforms/functional_pil.py:328: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
  interpolation: int = Image.BICUBIC,
Files already downloaded and verified
Files already downloaded and verified
Using downloaded and verified file: ./data/test_32x32.mat
  0%|                                                                                                                                                                                                                                                                                          | 0/10 [00:00<?, ?it/s]/home/rum/env/lib/python3.8/site-packages/torchvision/transforms/functional_pil.py:42: DeprecationWarning: FLIP_LEFT_RIGHT is deprecated and will be removed in Pillow 10 (2023-07-01). Use Transpose.FLIP_LEFT_RIGHT instead.
  return img.transpose(Image.FLIP_LEFT_RIGHT)
/home/rum/env/lib/python3.8/site-packages/torchvision/transforms/functional_pil.py:42: DeprecationWarning: FLIP_LEFT_RIGHT is deprecated and will be removed in Pillow 10 (2023-07-01). Use Transpose.FLIP_LEFT_RIGHT instead.
  return img.transpose(Image.FLIP_LEFT_RIGHT)
ELBO=94502457.776; test error=16.67%; LL=-0.5021
 10%|███████████████████████████▎                                                                                                                                                                                                                                                     | 1/10 [03:43<33:27, 223.04s/it]/home/rum/env/lib/python3.8/site-packages/torchvision/transforms/functional_pil.py:42: DeprecationWarning: FLIP_LEFT_RIGHT is deprecated and will be removed in Pillow 10 (2023-07-01). Use Transpose.FLIP_LEFT_RIGHT instead.
  return img.transpose(Image.FLIP_LEFT_RIGHT)
/home/rum/env/lib/python3.8/site-packages/torchvision/transforms/functional_pil.py:42: DeprecationWarning: FLIP_LEFT_RIGHT is deprecated and will be removed in Pillow 10 (2023-07-01). Use Transpose.FLIP_LEFT_RIGHT instead.
  return img.transpose(Image.FLIP_LEFT_RIGHT)