[Python] torch.optim - AttributeError: partially initialized module 'torch' has no attribute...

Discussão em 'Python' iniciado por Stack, Outubro 7, 2024.

  1. Stack

    Stack Membro Participativo

    Currently there is some issue about torch in my computer.

    When I initiate the below code,

    import torch.nn as nn
    import torch.nn.functional as F
    import numpy as np
    import torch


    It works but when I add "from torch.optim import Adam,AdamW"

    import torch.nn as nn
    import torch.nn.functional as F
    import numpy as np
    import torch

    from torch.optim import Adam,AdamW


    And initiate, then it gives me

    AttributeError: partially initialized module 'torch' has no attribute '_jit_internal' (most likely due to a circular import)

    This error. Can someone help me what is the problem?

    Know what is the actual problem

    Continue reading...

Compartilhe esta Página