snorkel-team / snorkel

A system for quickly generating training data with weak supervision
https://snorkel.org
Apache License 2.0
5.81k stars 857 forks source link

Bug thrown in LabelModel after I upgrade to Catalina and had to change Snorkel environment. #1606

Closed wimurr closed 4 years ago

wimurr commented 4 years ago

Snorkel Upgrade bug 2020-08-19_16-25-41.pdf

Issue description

A clear and concise description of what the bug is.

The LabelModel throws an error saying that the 'Graph' object has no attribute 'node' in graph_utils.py in get_clique_tree.

The only changes I made in my code were:

  1. I had to upgrade to Mac OS Catalina.
  2. I had to create a new Snorkel virtual environment (0.90).
  3. The code to import LabelModel seemed to no longer work as it seemed to now been in a different place, a submodule. Previously, I had:

from snorkel.labeling.model import LabelModel

What I changed it to, as I saw LabelModel had moved:

from snorkel.labeling.model.label_model import LabelModel

Code example/repro steps

Expected behavior

I just expected it to create a labeling model, as before.

Screenshots

See PDF.

System info

paroma commented 4 years ago

The specific error message is due to network changing their syntax between minor versions. You may find #1491 and #1494 relevant. Our Python requirements currently upperbound networkx to be <2.4.

wimurr commented 4 years ago

Thanks! Yes, I keep forgetting when I rebuild my Snorkel environment that it is crucially important that I run:

pip install -r requirements.txt

and not just rely on conda install snorkel. This time I wrote notes for the next time I have to go through an Apple major software upgrade.

I also had to rebuild scikit-learn following the instructions for MacOS at https://scikit-learn.org/0.21/developers/advanced_installation.html, specifically:

brew install libomp export CC=/usr/bin/clang export CXX=/usr/bin/clang++ export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp" export CFLAGS="$CFLAGS -I/usr/local/opt/libomp/include" export CXXFLAGS="$CXXFLAGS -I/usr/local/opt/libomp/include" export LDFLAGS="$LDFLAGS -L/usr/local/opt/libomp/lib -lomp" export DYLD_LIBRARY_PATH=/usr/local/opt/libomp/lib

before trying

pip install -r requirements.txt

again which failed the first time on sklearn and an issue with OpenMP. Thanks!