Skip to content

Commit

Permalink
Merge pull request #7 from mcbuehler/updates
Browse files Browse the repository at this point in the history
Remove try block when importing modules
  • Loading branch information
mcbuehler authored Mar 3, 2024
2 parents 9179115 + ebf8a63 commit a25979f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 26 deletions.
28 changes: 14 additions & 14 deletions varitex/demo.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import imageio
import torch

try:
from mutil.object_dict import ObjectDict
from varitex.data.keys_enum import DataItemKey as DIK
from varitex.data.uv_factory import BFMUVFactory
from varitex.modules.pipeline import PipelineModule
from varitex.visualization.batch import CompleteVisualizer
from varitex.options import varitex_default_options
except ModuleNotFoundError as e:
print(e)
print("Have you added VariTex to your pythonpath?")
print('To fix this error, go to the root path of the repository ".../VariTex/" \n '
'and run \n'
"export PYTHONPATH=$PYTHONPATH:$(pwd)")
exit()
# try:
from mutil.object_dict import ObjectDict
from varitex.data.keys_enum import DataItemKey as DIK
from varitex.data.uv_factory import BFMUVFactory
from varitex.modules.pipeline import PipelineModule
from varitex.visualization.batch import CompleteVisualizer
from varitex.options import varitex_default_options
# except ModuleNotFoundError as e:
# print(e)
# print("Have you added VariTex to your pythonpath?")
# print('To fix this error, go to the root path of the repository ".../VariTex/" \n '
# 'and run \n'
# "export PYTHONPATH=$PYTHONPATH:$(pwd)")
# exit()


class Demo:
Expand Down
17 changes: 5 additions & 12 deletions varitex/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,11 @@
from pytorch_lightning.loggers import WandbLogger, TensorBoardLogger
from torch.utils.data import DataLoader

try:
from varitex.custom_callbacks.callbacks import ImageLogCallback
from varitex.data.npy_dataset import NPYDataset
from varitex.modules.pipeline import PipelineModule
from varitex.options.train_options import TrainOptions
from mutil.files import copy_src, mkdir
except ModuleNotFoundError:
print("Have you added VariTex to your pythonpath?")
print('To fix this error, go to the root path of the repository ".../VariTex/" \n '
'and run \n'
"export PYTHONPATH=$PYTHONPATH:$(pwd)")
exit()
from varitex.custom_callbacks.callbacks import ImageLogCallback
from varitex.data.npy_dataset import NPYDataset
from varitex.modules.pipeline import PipelineModule
from varitex.options.train_options import TrainOptions
from mutil.files import copy_src, mkdir


if __name__ == "__main__":
Expand Down

0 comments on commit a25979f

Please sign in to comment.