Open kkh041124 opened 3 years ago
from .optimizer import Optimizer 이 부분을 #으로 막고 실행해보세요
Traceback (most recent call last):
File "main.py", line 26, in
from torch.optim import AdamW 가 있으니 class AdamW 로 선언합 부분이 필요없습니다 이 부분 삭제하시고 실행시켜보세쇼
오늘 오후 7시에 김윤기님의 모덜성능 성능향상 방법에 대한 zoom 강의가 있으니 꼭한번들어보세요 그러면 좀더 쉽게 optimizer 사용법에 대해 알수 있을겁니다
import os import math
import argparse import nsml import torch import torch.nn as nn import torchvision.models as models
from data_loader import feed_infer from data_local_loader import data_loader from torch.optim import AdamW from torch.optim.lr_scheduler import StepLR
from nsml import DATASET_PATH, IS_ON_NSML from evaluation import evaluation_metrics
from .optimizer import Optimizer
if IS_ON_NSML: TRAIN_DATASET_PATH = os.path.join(DATASET_PATH, 'train', 'train_data') else: DATASET_PATH = '/home/dataset/keris/'
class AdamW(Optimizer): r"""Implements AdamW algorithm.
@torch.no_grad()
class ClsResNet(models.ResNet): """Model definition.
def _infer(model, root_path, loader=None): """Local inference function for NSML infer.
def bind_nsml(model): """NSML binding function.
def load_weight(model): """Weight loading function.
def local_eval(model, loader, gt_path): """Local debugging function.
if name == 'main': args = argparse.ArgumentParser() args.add_argument("--num_classes", type=int, default=8)
이렇게 작성 했는데 Traceback (most recent call last): File "main.py", line 18, in
from .optimizer import Optimizer
ModuleNotFoundError: No module named 'main.optimizer'; 'main' is not a package
User session exited
이런 오류가 뜨는데 뭐가 문제일까요