Refefer / fastxml

FastXML / PFastXML / PFastreXML - Implementation of Extreme Multi-label Classification
Other
149 stars 47 forks source link

relative import #33

Closed yishairasowsky closed 4 years ago

yishairasowsky commented 4 years ago

@mlaprise @Refefer @codingsparse @siddu9501 what an awesome proudct you have produced! do you know how can solve this error... thanks!

root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML# cd /persistent/Sefaria-Project/ML ; env /usr/local/bin/python /root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/launcher 35679 -- /usr/local/lib/python3.7/site-packages/fastxml/trainer.py Traceback (most recent call last): File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/main.py", line 45, in cli.main() File "/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 430, in main run() File "/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 267, in run_file runpy.run_path(options.target, run_name=compat.force_str("main")) File "/usr/local/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/local/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/site-packages/fastxml/trainer.py", line 20, in from .splitter import Splitter, sparsify, sparse_mean_64, radius ImportError: attempted relative import with no known parent package root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML#

Refefer commented 4 years ago

This is a bit cryptic. Mind expanding on what you're trying to do?

On Wed, Jul 1, 2020 at 7:03 AM yishai notifications@github.com wrote:

root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML# cd /persistent/Sefaria-Project/ML ; env /usr/local/bin/python /root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/launcher 35679 -- /usr/local/lib/python3.7/site-packages/fastxml/trainer.py Traceback (most recent call last): File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/main.py", line 45, in cli.main() File "/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 430, in main run() File "/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 267, in run_file runpy.run_path(options.target, run_name=compat.force_str("main")) File "/usr/local/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/local/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/site-packages/fastxml/trainer.py", line 20, in

from .splitter import Splitter, sparsify, sparse_mean_64, radius ImportError: attempted relative import with no known parent package root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML# — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or unsubscribe .
yishairasowsky commented 4 years ago

wow, what a fast reply! thank you Andrew! of course, i will expand. i tried to utilize your awesome tools.

trainer = Trainer(n_trees=32, n_jobs=-1)
trainer.fit(x_train, y_train)
path = '/persistent/Sefaria-Project/ML/trainers/model.fxml'
trainer.save(path)
classifier = Inferencer(path)

test_predictions = classifier.predict(x_test) train_predictions = classifier.predict(x_train)

On Wed, Jul 1, 2020 at 6:42 PM Andrew Stanton notifications@github.com wrote:

This is a bit cryptic. Mind expanding on what you're trying to do?

On Wed, Jul 1, 2020 at 7:03 AM yishai notifications@github.com wrote:

root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML# cd /persistent/Sefaria-Project/ML ; env /usr/local/bin/python

/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/launcher 35679 -- /usr/local/lib/python3.7/site-packages/fastxml/trainer.py Traceback (most recent call last): File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/main.py", line 45, in cli.main() File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 430, in main run() File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 267, in run_file runpy.run_path(options.target, run_name=compat.force_str("main")) File "/usr/local/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/local/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/site-packages/fastxml/trainer.py", line 20, in

from .splitter import Splitter, sparsify, sparse_mean_64, radius ImportError: attempted relative import with no known parent package root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML# — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AALUUFKXA2UWYFSXAWT2EM3RZM6ZZANCNFSM4ONOISGA .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Refefer/fastxml/issues/33#issuecomment-652495201, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN7CN4FU7UD7DDZCNWRLC3RZNKMZANCNFSM4ONOISGA .

-- Yishai Rasowsky 054.848.2245 Visit my Shiurim https://torahdownloads.com/s-437-rabbi-yishai-rasowsky.html | Thesis https://www.amherst.edu/media/view/58703/original/jesse_thesis.pdf | Workplace https://www.smrtflow.com/ | Github https://github.com/yishairasowsky/info_about_your_location | Linked-In https://www.linkedin.com/in/yishai-rasowsky-a28189164/

yishairasowsky commented 4 years ago

my sense is that the key point in the error is this line > ImportError: attempted relative import with no known parent package

On Wed, Jul 1, 2020 at 7:42 PM Yishai Rasowsky yishairasowsky@gmail.com wrote:

wow, what a fast reply! thank you Andrew! of course, i will expand. i tried to utilize your awesome tools.

trainer = Trainer(n_trees=32, n_jobs=-1)
trainer.fit(x_train, y_train)
path = '/persistent/Sefaria-Project/ML/trainers/model.fxml'
trainer.save(path)
classifier = Inferencer(path)

test_predictions = classifier.predict(x_test) train_predictions = classifier.predict(x_train)

On Wed, Jul 1, 2020 at 6:42 PM Andrew Stanton notifications@github.com wrote:

This is a bit cryptic. Mind expanding on what you're trying to do?

On Wed, Jul 1, 2020 at 7:03 AM yishai notifications@github.com wrote:

root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML# cd /persistent/Sefaria-Project/ML ; env /usr/local/bin/python

/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/launcher 35679 -- /usr/local/lib/python3.7/site-packages/fastxml/trainer.py Traceback (most recent call last): File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/main.py", line 45, in cli.main() File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 430, in main run() File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 267, in run_file runpy.run_path(options.target, run_name=compat.force_str("main")) File "/usr/local/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/local/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/site-packages/fastxml/trainer.py", line 20, in

from .splitter import Splitter, sparsify, sparse_mean_64, radius ImportError: attempted relative import with no known parent package root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML# — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AALUUFKXA2UWYFSXAWT2EM3RZM6ZZANCNFSM4ONOISGA .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Refefer/fastxml/issues/33#issuecomment-652495201, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN7CN4FU7UD7DDZCNWRLC3RZNKMZANCNFSM4ONOISGA .

-- Yishai Rasowsky 054.848.2245 Visit my Shiurim https://torahdownloads.com/s-437-rabbi-yishai-rasowsky.html | Thesis https://www.amherst.edu/media/view/58703/original/jesse_thesis.pdf | Workplace https://www.smrtflow.com/ | Github https://github.com/yishairasowsky/info_about_your_location | Linked-In https://www.linkedin.com/in/yishai-rasowsky-a28189164/

-- Yishai Rasowsky 054.848.2245 Visit my Shiurim https://torahdownloads.com/s-437-rabbi-yishai-rasowsky.html | Thesis https://www.amherst.edu/media/view/58703/original/jesse_thesis.pdf | Workplace https://www.smrtflow.com/ | Github https://github.com/yishairasowsky/info_about_your_location | Linked-In https://www.linkedin.com/in/yishai-rasowsky-a28189164/

Refefer commented 4 years ago

Are you installing the package with setup.py or are you trying to run it from within the fastxml directory? If it's the latter, it'll fail: you need to install it into your virtualenv or whichever dependency manager you are using.

python setup.py develop or python setup.py develop and that will ensure the package is available anywhere you would want to run a script.

Let me know if that helps :)

On Wed, Jul 1, 2020 at 9:43 AM yishai notifications@github.com wrote:

my sense is that the key point in the error is this line > ImportError: attempted relative import with no known parent package

On Wed, Jul 1, 2020 at 7:42 PM Yishai Rasowsky yishairasowsky@gmail.com wrote:

wow, what a fast reply! thank you Andrew! of course, i will expand. i tried to utilize your awesome tools.

trainer = Trainer(n_trees=32, n_jobs=-1) trainer.fit(x_train, y_train) path = '/persistent/Sefaria-Project/ML/trainers/model.fxml' trainer.save(path) classifier = Inferencer(path) test_predictions = classifier.predict(x_test) train_predictions = classifier.predict(x_train)

On Wed, Jul 1, 2020 at 6:42 PM Andrew Stanton notifications@github.com wrote:

This is a bit cryptic. Mind expanding on what you're trying to do?

On Wed, Jul 1, 2020 at 7:03 AM yishai notifications@github.com wrote:

root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML# cd /persistent/Sefaria-Project/ML ; env /usr/local/bin/python

/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/launcher

35679 -- /usr/local/lib/python3.7/site-packages/fastxml/trainer.py Traceback (most recent call last): File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/main.py",

line 45, in cli.main() File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py",

line 430, in main run() File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py",

line 267, in run_file runpy.run_path(options.target, run_name=compat.force_str("main")) File "/usr/local/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/local/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/site-packages/fastxml/trainer.py", line 20, in

from .splitter import Splitter, sparsify, sparse_mean_64, radius ImportError: attempted relative import with no known parent package root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML# — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AALUUFKXA2UWYFSXAWT2EM3RZM6ZZANCNFSM4ONOISGA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Refefer/fastxml/issues/33#issuecomment-652495201, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJN7CN4FU7UD7DDZCNWRLC3RZNKMZANCNFSM4ONOISGA

.

-- Yishai Rasowsky 054.848.2245 Visit my Shiurim https://torahdownloads.com/s-437-rabbi-yishai-rasowsky.html | Thesis https://www.amherst.edu/media/view/58703/original/jesse_thesis.pdf | Workplace https://www.smrtflow.com/ | Github https://github.com/yishairasowsky/info_about_your_location | Linked-In https://www.linkedin.com/in/yishai-rasowsky-a28189164/

-- Yishai Rasowsky 054.848.2245 Visit my Shiurim https://torahdownloads.com/s-437-rabbi-yishai-rasowsky.html | Thesis https://www.amherst.edu/media/view/58703/original/jesse_thesis.pdf | Workplace https://www.smrtflow.com/ | Github https://github.com/yishairasowsky/info_about_your_location | Linked-In https://www.linkedin.com/in/yishai-rasowsky-a28189164/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Refefer/fastxml/issues/33#issuecomment-652529058, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALUUFJASTZUGUL53IHFV53RZNRU3ANCNFSM4ONOISGA .

yishairasowsky commented 4 years ago

awesome! thank you Andrew!!!

On Wed, Jul 1, 2020 at 7:49 PM Andrew Stanton notifications@github.com wrote:

Are you installing the package with setup.py or are you trying to run it from within the fastxml directory? If it's the latter, it'll fail: you need to install it into your virtualenv or whichever dependency manager you are using.

python setup.py develop or python setup.py develop and that will ensure the package is available anywhere you would want to run a script.

Let me know if that helps :)

On Wed, Jul 1, 2020 at 9:43 AM yishai notifications@github.com wrote:

my sense is that the key point in the error is this line > ImportError: attempted relative import with no known parent package

On Wed, Jul 1, 2020 at 7:42 PM Yishai Rasowsky <yishairasowsky@gmail.com

wrote:

wow, what a fast reply! thank you Andrew! of course, i will expand. i tried to utilize your awesome tools.

trainer = Trainer(n_trees=32, n_jobs=-1) trainer.fit(x_train, y_train) path = '/persistent/Sefaria-Project/ML/trainers/model.fxml' trainer.save(path) classifier = Inferencer(path) test_predictions = classifier.predict(x_test) train_predictions = classifier.predict(x_train)

On Wed, Jul 1, 2020 at 6:42 PM Andrew Stanton < notifications@github.com> wrote:

This is a bit cryptic. Mind expanding on what you're trying to do?

On Wed, Jul 1, 2020 at 7:03 AM yishai notifications@github.com wrote:

root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML# cd /persistent/Sefaria-Project/ML ; env /usr/local/bin/python

/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/launcher

35679 -- /usr/local/lib/python3.7/site-packages/fastxml/trainer.py Traceback (most recent call last): File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/main.py",

line 45, in cli.main() File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py",

line 430, in main run() File

"/root/.vscode-server/extensions/ms-python.python-2020.6.91350/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py",

line 267, in run_file runpy.run_path(options.target, run_name=compat.force_str("main")) File "/usr/local/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/local/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/site-packages/fastxml/trainer.py", line 20, in

from .splitter import Splitter, sparsify, sparse_mean_64, radius ImportError: attempted relative import with no known parent package root@yishai-remotedocker-0:/persistent/Sefaria-Project/ML# — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AALUUFKXA2UWYFSXAWT2EM3RZM6ZZANCNFSM4ONOISGA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/Refefer/fastxml/issues/33#issuecomment-652495201 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AJN7CN4FU7UD7DDZCNWRLC3RZNKMZANCNFSM4ONOISGA

.

-- Yishai Rasowsky 054.848.2245 Visit my Shiurim https://torahdownloads.com/s-437-rabbi-yishai-rasowsky.html | Thesis https://www.amherst.edu/media/view/58703/original/jesse_thesis.pdf | Workplace https://www.smrtflow.com/ | Github https://github.com/yishairasowsky/info_about_your_location | Linked-In https://www.linkedin.com/in/yishai-rasowsky-a28189164/

-- Yishai Rasowsky 054.848.2245 Visit my Shiurim https://torahdownloads.com/s-437-rabbi-yishai-rasowsky.html | Thesis https://www.amherst.edu/media/view/58703/original/jesse_thesis.pdf | Workplace https://www.smrtflow.com/ | Github https://github.com/yishairasowsky/info_about_your_location | Linked-In https://www.linkedin.com/in/yishai-rasowsky-a28189164/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Refefer/fastxml/issues/33#issuecomment-652529058, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AALUUFJASTZUGUL53IHFV53RZNRU3ANCNFSM4ONOISGA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Refefer/fastxml/issues/33#issuecomment-652531704, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN7CN3WXFKPNS3IIXNZNILRZNSIZANCNFSM4ONOISGA .

-- Yishai Rasowsky 054.848.2245 Visit my Shiurim https://torahdownloads.com/s-437-rabbi-yishai-rasowsky.html | Thesis https://www.amherst.edu/media/view/58703/original/jesse_thesis.pdf | Workplace https://www.smrtflow.com/ | Github https://github.com/yishairasowsky/info_about_your_location | Linked-In https://www.linkedin.com/in/yishai-rasowsky-a28189164/

Refefer commented 4 years ago

Marking closed. Let me know if this didn't help :)