callummcdougall / sae_vis

Create feature-centric and prompt-centric visualizations for sparse autoencoders (like those from Anthropic's published research).
MIT License
165 stars 34 forks source link

ModuleNotFoundError: No module named 'sae_lens.training.session_loader' #58

Open amrzv opened 3 weeks ago

amrzv commented 3 weeks ago

Hi. When running demo.ipynb notebook the

ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-12-43ab3eb54e84>](https://localhost:8080/#) in <cell line: 1>()
----> 1 from sae_lens.training.session_loader import LMSparseAutoencoderSessionloader
      2 from sae_lens.training.activations_store import ActivationsStore
      3 from tqdm import tqdm
      4 
      5 # Get gpt2 model

ModuleNotFoundError: No module named 'sae_lens.training.session_loader'

raised. Also

ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-16-203c95955679>](https://localhost:8080/#) in <cell line: 29>()
     27 from sae_vis.data_storing_fns import SaeVisData
     28 from sae_vis.data_config_classes import SaeVisConfig
---> 29 from sae_lens.training.sparse_autoencoder import SparseAutoencoder
     30 # from sae_lens.training.training_sae import TrainingSAE as SparseAutoencoder
     31 

ModuleNotFoundError: No module named 'sae_lens.training.sparse_autoencoder'

Is it because of the missing dependency sae-lens?

P.S: installing pip install sae-lens doesn't help.

callummcdougall commented 3 days ago

Sorry for getting to this so late! I think this is because the sae lens that's being referred to here is an older version that was tied to the work done on that library during the MATS program; it should work if the version is pinned to an earlier version (not exactly sure what version that would be, but you can see the version history here). Alternatively, I think instead I'd recommend using the newer branch described in the readme, which I expect will become the canonical branch next week when I get around to finishing my updates.