Comments (11)
Wow, good catch! Thanks for the reference -- it saved me an evening of (probably very frustrating) googling. I think I have it fixed, but I would greatly appreciate it if you can test on your system (if you have time) to ensure that it does indeed resolve the issue for you. Thanks!
from umap.
I am encountering the same exact error even after your change.
from umap.
If that's the case then I must admit I am really not sure what the correct fix is -- this involves numba internals which I am not familiar with. I'll have to try and ask numba developers what the right solution to this is, which unfortunately may take a while. As an interim solution you can check out the code and simply remove or comment out code blocks
if verbose:
print(...)
Ultimately I would prefer a more complete solution though, as the progress logging is really quite useful.
from umap.
This is strange. I could try changing the prints to the logging module, but it looks like the problem comes during a string conversion, not the print function.
Does this happen always with python 2.7? Is there a formula for recreating the issue so I can play around with it?
from umap.
I am using python2.7 yes. I just ran the examples/digits/digits.py code nothing from my side and it gave this error:
raise NotImplementedError("cannot convert native %s to Python object" % (typ,))
LoweringError: cannot convert native const('\tnn descent iteration ') to Python object
File "build/bdist.linux-x86_64/egg/umap/umap_.py", line 455
[1] During: lowering "print($515.5)" at build/bdist.linux-x86_64/egg/umap/umap_.py (455)
Failed at nopython (nopython mode backend)
cannot convert native const('\tnn descent iteration ') to Python object
File "build/bdist.linux-x86_64/egg/umap/umap_.py", line 455
[1] During: lowering "print($515.5)" at build/bdist.linux-x86_64/egg/umap/umap_.py (455)
Thanks removing the if verbose, made it work.
from umap.
I suspect the logging module will not play nicely with numba; perhaps this is a python2/python3 compatability issue related to the print function? @sauln if you have some time to look into this I would greatly appreciate it as I don't have a lot of time for the next week or so.
from umap.
I think it's some combination of print statements and string operations in python 2.
Multiple print arguments like
print("hello", "world")
cause the error and I haven't figured out any other way to format strings in numba.
This issue talks briefly about numba+print, but it was closed without explicit resolution.
I haven't found any way around this problem. There might be something in the numba documentation, but nothing has come up from google searches. I'll try to dig a bit more into this tomorrow.
from umap.
Thanks Nathaniel, at least we know what the likely issue is. One possibility is to use cffi and get the printf function from C to do the formatted printing, but that adds an extra dependency on cffi. Another option would be to explicitly write a very constrained function to do the limited format of printing we need and call that instead. I would welcome other ideas as neither of those seem optimal.
from umap.
It might be hacky, but it should be possible to require cffi only for python2.7. That would force maintenance of two different logging systems though. As a first step, it's probably easiest to disable all logging on 2.7.
What do you think about having different behavior for 2.7 and 3? It's not ideal, but at least that way, 3+ could have complete and pretty logging.
from umap.
from umap.
I’ll look into it tonight.
from umap.
Related Issues (20)
- No module named 'pkg_resources' HOT 2
- connectivity plot values not comparable with UMAP transform output
- Penguins example SSL error
- ZeroDivisonError while running update with new data
- No module named importlib HOT 2
- When using umap fit, an error occurred suddenly: Intel MKL ERROR: Parameter 6 was incorrect on entry to DLASWP.
- scipy.sparse._csparsetools.lil_get_lengths Error Running UMAP
- Not able to work with old embedder object created using python 3.8 HOT 1
- Setting a random state still leads to stochastic results
- Implementation of sciki-learn's get_feature_names_out() API is not correct
- Is 'n_training_epochs' working for parameteric UMAP?
- visualize video data
- How to combine UMAP models in new data?
- Edit instructions to make them compatible with zsh
- Empty API page on UMAP API Guide? HOT 1
- PCA diagnostic error HOT 2
- Speed inquries HOT 2
- UMAP crashes when torch also imported before first run HOT 2
- Unable to pickle trained UMAP instance
- Reducing Model Size for UMAP on Large Datasets HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from umap.