openclimatefix / openclimatefix/metnet

metnet 2 import issue

Open
#70 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
305
Forks
64
Avg merge
5d 4h
Merged PRs (30d)
1

Description

I am facing issues after installing Metnet2, I am running on python 3.9.2 in a conda environment.

Bug Report

Describe the Bug

Attempting to import MetNet and MetNet2 from the metnet package results in a ModuleNotFoundError. Specifically, the error indicates that the module metnet.layers cannot be found:

ModuleNotFoundError: No module named 'metnet.layers'; 'metnet' is not a package

This error occurs when attempting to run the following code:

from metnet import MetNet, MetNet2

# Load pre-trained models
model = MetNet().from_pretrained("openclimatefix/metnet")
model = MetNet2().from_pretrained("openclimatefix/metnet-2")
To Reproduce

Steps to reproduce the behavior:

  1. Ensure that the metnet repository is cloned and installed.
  2. Open a Python environment within the project directory.
  3. Run the import statements and model loading code:
    from metnet import MetNet, MetNet2
    model = MetNet().from_pretrained("openclimatefix/metnet")
    model = MetNet2().from_pretrained("openclimatefix/metnet-2")
    
  4. Observe the ModuleNotFoundError.
Expected Behavior

The expected behavior is that the MetNet and MetNet2 classes are successfully imported, and the from_pretrained method loads pre-trained models without errors.

Additional Context
  • Error Message:
    ModuleNotFoundError: No module named 'metnet.layers'; 'metnet' is not a package
    

can anyone help me with this?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the import from the cloned and installed repository in a Python 3.9.2 conda environment. Inspect the metnet package layout and installation context around the missing metnet.layers module. Done means importing MetNet and MetNet2 succeeds and both from_pretrained calls load without the reported ModuleNotFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.