Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test & Score deepcopy problem #2793

Closed
gpstmp opened this issue Nov 23, 2017 · 3 comments
Closed

Test & Score deepcopy problem #2793

gpstmp opened this issue Nov 23, 2017 · 3 comments

Comments

@gpstmp
Copy link

gpstmp commented Nov 23, 2017

Orange version

3.7.1

Expected behavior

I expect that Test & Score widget will work ok with Recommendations add-on widget (this model was working ok in prev versions of Orange, but produces an error after update).

Actual behavior

I have this error in logs:

----------------------------- TypeError Exception -----------------------------
Traceback (most recent call last):
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/Orange/canvas/scheme/widgetsscheme.py", line 842, in process_signals_for_widget
    widget.handleNewSignals()
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/Orange/widgets/evaluate/owtestlearners.py", line 486, in handleNewSignals
    self.__update()
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/Orange/widgets/evaluate/owtestlearners.py", line 786, in __update
    learners_c = [copy.deepcopy(learner) for learner in learners]
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/Orange/widgets/evaluate/owtestlearners.py", line 786, in <listcomp>
    learners_c = [copy.deepcopy(learner) for learner in learners]
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/copy.py", line 247, in _deepcopy_method
    return type(x)(x.__func__, deepcopy(x.__self__, memo))
  File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/copy.py", line 169, in deepcopy
    rv = reductor(4)
TypeError: can't pickle OWSVDPlusPlus objects
-------------------------------------------------------------------------------
Steps to reproduce the behavior

You can download a simple example here
problem.zip

Additional info (worksheets, data, screenshots, ...)
@kernc
Copy link
Contributor

kernc commented Nov 24, 2017

Seems like Orange3-recommendation problem. I get:

PicklingError: Can't pickle <class 'Orange.widgets.utils.owlearnerwidget.Outputs'>: attribute lookup Outputs on Orange.widgets.utils.owlearnerwidget failed

@kernc
Copy link
Contributor

kernc commented Nov 24, 2017

@gpstmp Would you care enough to help us migrate recommender add-on's widgets to use new-style signals in a pull request?

@astaric
Copy link
Member

astaric commented Nov 24, 2017

The core problem is that (one of the) learners in c_learners holds a reference to the widget it was constructed with. This is a bad thing, but as @kernc said, a problem in orange3-recommendation add-on.

I have opened a new issue on that repository, let's move the discussion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants