SwapNet icon indicating copy to clipboard operation
SwapNet copied to clipboard

ModuleNotFoundError: No module named 'model'

Open ayush9198gupta opened this issue 5 years ago • 3 comments

Hi,

I am running your model on colab , I have already run the file (make.sh) successfully but when I am running the command python train.py it stuck on following error which is not solved

model warp
Traceback (most recent call last):
  File "train.py", line 32, in <module>
    opt = TrainOptions().parse(store_options=True)  # get training options
  File "/content/drive/My Drive/Angelium/fashion_recommandation/SwapNet/SwapNet/options/base_options.py", line 212, in parse
    opt = self.gather_options()
  File "/content/drive/My Drive/Angelium/fashion_recommandation/SwapNet/SwapNet/options/base_options.py", line 181, in gather_options
    options_modifier = import_source.get_options_modifier(name)
  File "/content/drive/My Drive/Angelium/fashion_recommandation/SwapNet/SwapNet/models/__init__.py", line 29, in get_options_modifier
    model_class = find_model_using_name(model_name)
  File "/content/drive/My Drive/Angelium/fashion_recommandation/SwapNet/SwapNet/models/__init__.py", line 12, in find_model_using_name
    modellib = importlib.import_module(model_filename)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/content/drive/My Drive/Angelium/fashion_recommandation/SwapNet/SwapNet/models/warp_model.py", line 10, in <module>
    from modules.swapnet_modules import WarpModule
  File "/content/drive/My Drive/Angelium/fashion_recommandation/SwapNet/SwapNet/modules/swapnet_modules.py", line 14, in <module>
    from model.roi_layers import ROIAlign
ModuleNotFoundError: No module named 'model'

Kindly help to solve this issue. Thanks

ayush9198gupta avatar May 08 '20 10:05 ayush9198gupta

Hi, please try checking out the feat/torchvision-roi-align branch.

andrewjong avatar May 09 '20 04:05 andrewjong

Hi @andrewjong

Can you please specify the path or what can be done to fix the issue.

I am following below instructions:

cd /content/drive/My Drive/Ayush Gupta/swapnet/SwapNet/

then !python train.py --name deep_fashion/ --model warp --dataroot data/deep_fashion/

while execute the above it revert back me with error

model warp Traceback (most recent call last): File "train.py", line 33, in <module> opt = TrainOptions().parse(store_options=True) # get training options File "/content/drive/My Drive/Ayush Gupta/swapnet/SwapNet/options/base_options.py", line 212, in parse opt = self.gather_options() File "/content/drive/My Drive/Ayush Gupta/swapnet/SwapNet/options/base_options.py", line 181, in gather_options options_modifier = import_source.get_options_modifier(name) File "/content/drive/My Drive/Ayush Gupta/swapnet/SwapNet/models/__init__.py", line 29, in get_options_modifier model_class = find_model_using_name(model_name) File "/content/drive/My Drive/Ayush Gupta/swapnet/SwapNet/models/__init__.py", line 12, in find_model_using_name modellib = importlib.import_module(model_filename) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/content/drive/My Drive/Ayush Gupta/swapnet/SwapNet/models/warp_model.py", line 10, in <module> from modules.swapnet_modules import WarpModule File "/content/drive/My Drive/Ayush Gupta/swapnet/SwapNet/modules/swapnet_modules.py", line 14, in <module> from model.roi_layers import ROIAlign ModuleNotFoundError: No module named 'model'

Kindly suggest Thanks

ayush9198gupta avatar May 09 '20 06:05 ayush9198gupta

I have since merged the torchvision version of ROI into master. Should be able to work on the master branch now, after a git pull.

andrewjong avatar Jun 18 '20 18:06 andrewjong