Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'landmarks' #1

Closed
abhinavkaul95 opened this issue May 6, 2021 · 6 comments
Closed

No module named 'landmarks' #1

abhinavkaul95 opened this issue May 6, 2021 · 6 comments
Labels
good first issue Good for newcomers

Comments

@abhinavkaul95
Copy link

Hi @piaozhx,

Couuld you please tell what should I do to get rid of the error? I am trying to run the training of the model using the command:
CUDA_VISIBLE_DEVICES=0,1 python train.py lbyl_lstm_referit_batch64 --workers 8 --distributed --world_size 1 --dist_url "tcp://127.0.0.1:60006"

but I am getting the following error:

ngpus_per_node 2
/media/disk/user/abhinav/LBYLNet/core/../data/refer/data/referit/corpus.pth
/media/disk/user/abhinav/LBYLNet/core/../data/refer/data/referit/corpus.pth
/media/disk/user/abhinav/LBYLNet/env/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead.
  warnings.warn(warning.format(ret))
/media/disk/user/abhinav/LBYLNet/env/lib/python3.6/site-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead.
  warnings.warn(warning.format(ret))
/media/disk/user/abhinav/LBYLNet/env/lib/python3.6/site-packages/torch/nn/modules/rnn.py:50: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects num_layers greater than 1, but got dropout=0.2 and num_layers=1
  "num_layers={}".format(dropout, num_layers))
/media/disk/user/abhinav/LBYLNet/env/lib/python3.6/site-packages/torch/nn/modules/rnn.py:50: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects num_layers greater than 1, but got dropout=0.2 and num_layers=1
  "num_layers={}".format(dropout, num_layers))
Traceback (most recent call last):
  File "train.py", line 375, in <module>
    mp.spawn(main, nprocs=ngpus_per_node, args=(ngpus_per_node, args))
  File "/media/disk/user/abhinav/LBYLNet/env/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 171, in spawn
    while not spawn_context.join():
  File "/media/disk/user/abhinav/LBYLNet/env/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 118, in join
    raise Exception(msg)
Exception: 

-- Process 1 terminated with the following error:
Traceback (most recent call last):
  File "/media/disk/user/abhinav/LBYLNet/env/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 19, in _wrap
    fn(i, *args)
  File "/media/disk/user/abhinav/LBYLNet/train.py", line 300, in main
    model = LBYLNet(system_config, config["db"])
  File "/media/disk/user/abhinav/LBYLNet/core/models/net/lbylnet.py", line 59, in __init__
    self.context_block = context.get(cfg_sys.context)(self.joint_out_dim, mapdim=self.map_dim)
  File "/media/disk/user/abhinav/LBYLNet/core/models/context/module.py", line 120, in __init__
    self._init_layers(dim)
  File "/media/disk/user/abhinav/LBYLNet/core/models/context/module.py", line 137, in _init_layers
    from ._pconv.conv4 import TopLeftPool, TopRightPool, BottomLeftPool, BottomRightPool
  File "/media/disk/user/abhinav/LBYLNet/core/models/context/_pconv/conv4.py", line 3, in <module>
    import landmarks
ModuleNotFoundError: No module named 'landmarks'
@abhinavkaul95
Copy link
Author

Also commenting the import landmarks is giving the following error:

Traceback (most recent call last):
  File "/media/disk/user/abhinav/LBYLNet/env/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 19, in _wrap
    fn(i, *args)
  File "/media/disk/user/abhinav/LBYLNet/train.py", line 300, in main
    model = LBYLNet(system_config, config["db"])
  File "/media/disk/user/abhinav/LBYLNet/core/models/net/lbylnet.py", line 59, in __init__
    self.context_block = context.get(cfg_sys.context)(self.joint_out_dim, mapdim=self.map_dim)
  File "/media/disk/user/abhinav/LBYLNet/core/models/context/module.py", line 120, in __init__
    self._init_layers(dim)
  File "/media/disk/user/abhinav/LBYLNet/core/models/context/module.py", line 137, in _init_layers
    from ._pconv.conv4 import TopLeftPool, TopRightPool, BottomLeftPool, BottomRightPool
  File "/media/disk/user/abhinav/LBYLNet/core/models/context/_pconv/conv4.py", line 8, in <module>
    from landmarkconv import _C
ImportError: cannot import name '_C'

I have run the make command and that has run successfully, ending with Finished processing dependencies for landmarkconv==0.0.0

@hbb1
Copy link
Collaborator

hbb1 commented May 8, 2021

@abhinavkaul95 Thanks for your reminder, "import landmarks" should be commented. As for the ImportError, I think you may check if the landmarkconv install correctly by running the landmarkconv/lib/test.py.

@hbb1 hbb1 added the good first issue Good for newcomers label May 8, 2021
@abhinavkaul95
Copy link
Author

Trying to run the script landmarkconv/lib/test.py after adding ext as PYTHONPATH in Ubuntu, this is giving the same error:

Traceback (most recent call last):
  File "lib/test.py", line 7, in <module>
    from layers.conv4 import TopLeftPool, TopRightPool, BottomLeftPool, BottomRightPool
  File "/media/disk/user/abhinav/LBYLNet/ext/landmarkconv/lib/layers/conv4.py", line 7, in <module>
    from landmarkconv import _C
ImportError: cannot import name '_C'

@hbb1
Copy link
Collaborator

hbb1 commented May 8, 2021

@abhinavkaul95 Can you provide the landmarkconv's install log? Also, make sure that you use gcc 5.0 and CUDA support.

@hbb1
Copy link
Collaborator

hbb1 commented May 8, 2021

@abhinavkaul95 As far as I concern, there is one possible can cause this problem. Trying to modify Makefile,

all:
	rm -rf dist
	rm -rf *.egg-info
	rm -rf build
	#python setup.py install --user
        python setup.py install

@abhinavkaul95
Copy link
Author

Thanks @piaozhx, that has solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants