marcoaversa / diffinfinite

DiffInfinite Official Code
MIT License
30 stars 4 forks source link

train config yaml system does not correctly load local variable #3

Open joihn opened 7 months ago

joihn commented 7 months ago

hanks for this repo, I'm launching a training with python 3.10, via pycharm IDE. when executing: python train.py --config_file=./config/image_gen_train.yaml

the nominal user would expect image_gen_train.yaml params to be loaded. However they are NOT.

https://github.com/marcoaversa/diffinfinite/blob/4d2309606e5ce6190828b96f436cfa962ec5d1ec/train.py#L34 this syntax seems uneffective to change local variable. Thus local variable stay unchanged by the config.

relevant stackoverflow : https://stackoverflow.com/questions/30295163/update-locals-from-inside-a-function

env: ubuntu 20 with the below presented docker container python 3.10.11 dockerfile for my developer environment:

# Dockerfile inspired by https://github.com/open-mmlab/mmsegmentation/blob/1.x/docker/Dockerfile

ARG PYTORCH="2.0.1"
ARG CUDA="11.7"
ARG CUDNN="8"

ARG PYTHON_VERSION="3.10"

FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel as diffusion
ARG DEBIAN_FRONTEND=noninteractive

ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6 8.9+PTX"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"

RUN apt-get update && apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1 wget vim nano \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
RUN pip install scikit-learn opencv-python pandas
joihn commented 7 months ago

I can confirm that launching a training via CLI (not via pycharm ) results in the same behavior

marcoaversa commented 7 months ago

thanks for your feedback, the code will be fixed as soon as possible.