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

Needs help even to reproduce tutorial #110

Open
kimdn opened this issue Sep 30, 2024 · 2 comments
Open

Needs help even to reproduce tutorial #110

kimdn opened this issue Sep 30, 2024 · 2 comments

Comments

@kimdn
Copy link

kimdn commented Sep 30, 2024

I installed TomoTwin with
pip install tomotwin-cryoet

Then embedding

TomoTwin_model="/home/kimd999/brave/DN/model/TomoTwin/model/tomotwin_latest_2024_Sep.pth"
input_tomo="tomo/tomo.mrc"
batch_size="256"

# If you run into memory issues, reduce the batchsize (-b).
CUDA_VISIBLE_DEVICES=0,1 tomotwin_embed.py tomogram -m $TomoTwin_model -v $input_tomo -b $batch_size -o out/embed/tomo/ -s 2

worked well since I didn't see an obvious error during this embedding as

  Skip version check, as it failed with the following error:
  <urlopen error [Errno 101] Network is unreachable>
  ###############################################
  Found 2 GPU(s). Start DDP + Compiling.
  reading /home/kimd999/brave/DN/model/TomoTwin/model/tomotwin_latest_2024_Sep.pth
  reading /home/kimd999/brave/DN/model/TomoTwin/model/tomotwin_latest_2024_Sep.pth
  Model config:
  {'identifier': 'SiameseNet', 'network_config': {'output_channels': 32, 'dropout': 0.2, 'repeat_layers': 0, 'norm_name': 'GroupNor\
  m', 'norm_kwargs': {'num_groups': 64, 'num_channels': 1024}, 'gem_pooling_p': 0}, 'train_config': {'loss': 'TripletLoss', 'tl_mar\
  gin': 0.539, 'miner': True, 'miner_margin': 0.734, 'learning_rate': 5.945e-05, 'optimizer': 'Adam', 'weight_decay': 0, 'batchsize\
  ': 35, 'patience': 50, 'aug_train_shift_distance': 2}, 'distance': 'COSINE', 'window_size': (37, 37, 37)}
  Embeddings have shape: (5083356, 35)
  Wrote embeddings to disk to out/embed/tomo/tomo_embeddings.temb
  Done.
  Tomogram embedding completed in 0h:36m:9s.

However, generating umap with default n_neighbors
tomotwin_tools.py umap -i $output_of_embedding -o $output_of_umap
failed as

  RuntimeError: RAFT failure at file=/opt/conda/conda-bld/work/cpp/src/umap/knn_graph/algo.cuh line=115: n_neighbors should be smaller than the graph degree computed by nn descent
  Obtained 32 stack frames

Here (umap calculation), input file ($output_of_embedding) is tomo_embeddings.temb (output from embedding).

I know that default n_neighbors for TomoTwin umap is 200.

@thorstenwagner
Copy link
Collaborator

Hi @kimdn ! Thanks for letting us know. There seems to be a problem with an updated version of cuml ( rapidsai/cuml#6091 ). For now, a fix to your problem is to add --neighbors=64 to your umap command. Be aware that it might affect the umap. We will provide a fix as soon as possible.

@kimdn
Copy link
Author

kimdn commented Oct 2, 2024

Thank you for your comment @thorstenwagner

Since version of dependent library matters, I think that sharing apptainer container (e.g., https://github.com/cbmi-group/DeepETPicker?tab=readme-ov-file#option-2using-docker) might help everyone (i.e., developer, user).

Yes, I know that intentional decrease of n_neighbors (e.g., into 25~50) ran embedding part without an error.

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

No branches or pull requests

2 participants