Closed ronikobrosly closed 2 years ago
@ronikobrosly I am the author of the C chunk.
1) It must be compiled, a step carried out by setup.py. I suspect you may not have done pip install -e .
.
2) It very heavily uses AVX2 and FMA vector extensions, available only on CPUs Intel Haswell/AMD Excavator and newer. A runtime CPU detection code rejects loading the module on CPUs that are too old. I don't see the warning it prints in your error message, so I really suspect you're still at problem 1), but I may be mistaken.
Thank you for the heads up @obilaniu ! I will try this later today and report back here.
Hi @obilaniu , unfortunately that did not seem to work. I ran both pip install -e .
and python setup.py develop
. When I run
python run.py train --seed 1 --train_functional 10000 --mopt adam:5e-2,0.9 --gopt adam:5e-3,0.1 -v 500 --lsparse 0.1 --bs 256 --ldag 0.5 --predict 100 --temperature 1 --limit-samples 500 -N 2 -p confounder3
I still get AttributeError: module 'causal' has no attribute '_causal'
.
Do you have any more ideas?
@ronikobrosly Well, I'll guess based on your paths that you're on macOS.
I never developed for that platform specifically, and because Apple does things differently I had to disable my CPU check for too-old compilers. My vector code will also 100% not work on very new M1 chips because they're not x86_64 architecture but Aarch64.
Assuming you're still on one of the Intel-based Macs, I propose you remove the try-except
from around the import
here and say what error message it gives, and furthermore check whether there is a newly-compiled library causal/_causal*.{so|dylib}
(or something like that). If there is not, I'd suggest you try pip install -v -e .
to see more verbosely what's going on.
I would not be surprised to learn that it failed to compile (x86_64 code will not compile on Aarch64), or fails to import with a failing CPU check (x86_64 CPU is too old).
Ahhh, welp you basically guessed it, Im using a new Macbook Pro with the M1 chip. Oh well, thanks for your help though!
Hello @nke001 , I'm thrilled you put together this package and I just finished reading the corresponding paper. I seem to have a problem running this in my python 3.9.6 virtual environment. I'm able to install all of the requirements, but when I run the command
python run.py train --seed 1 --train_functional 10000 --mopt adam:5e-2,0.9 --gopt adam:5e-3,0.1 -v 500 --lsparse 0.1 --bs 256 --ldag 0.5 --predict 100 --temperature 1 --limit-samples 500 -N 2 -p confounder3
as listed in your README, I get the following error:So it seems I'm not able to read the
_causal.c
file in the package. I imagine this is because it's written inC
. Could you help me understand what I'm doing wrong here?