intro-stat-learning / ISLP_labs

Up-to-date version of labs for ISLP
BSD 2-Clause "Simplified" License
751 stars 435 forks source link

seed_everything() unavailable in requirements.txt pytorch-lightning version #11

Open kylebeni opened 1 year ago

kylebeni commented 1 year ago

pytorch_lighting.utilities.seed.seed_everything() appears to have been deprecated in the 2.0 release. For use of this function, latest available version with it is 1.9.5.

This function is referenced in the Chapter 10 lab.

This line of code needs to be updated:

https://github.com/intro-stat-learning/ISLP_labs/blob/b5ecc83a950ee4cb9e6a40e697ce062ae74dcb29/requirements.txt#L13

jonathan-taylor commented 1 year ago

Can you tell me what version of ISLP labs you're running?

Are you running stable​ as indicated here? https://intro-stat-learning.github.io/ISLP/labs.html

If you're running from the PDF there are some changes (you can read about them on the forum on statlearning.com).

The stable​ version of the labs has corrected this import:

https://github.com/intro-stat-learning/ISLP_labs/blob/v2.1.2/Ch10-deeplearning-lab.Rmd#L94

Please let me know if stable​ labs still raise an exception....


From: Kyle @.> Sent: Wednesday, September 20, 2023 11:44 AM To: intro-stat-learning/ISLP_labs @.> Cc: Subscribed @.***> Subject: [intro-stat-learning/ISLP_labs] pytorch-lightning version is wrong (Issue #11)

pytorch_lighting.utilities.seed.seed_everything() appears to have been deprecatedhttps://lightning.ai/docs/pytorch/2.0.0/api/lightning.pytorch.utilities.seed.html#module-lightning.pytorch.utilities.seed in the 2.0 release. For use of this function, latest available version with it is 1.9.5https://lightning.ai/docs/pytorch/2.0.6/api/lightning.pytorch.utilities.seed.html#module-lightning.pytorch.utilities.seed.

This line of code needs to be updated:

https://github.com/intro-stat-learning/ISLP_labs/blob/b5ecc83a950ee4cb9e6a40e697ce062ae74dcb29/requirements.txt#L13

— Reply to this email directly, view it on GitHubhttps://github.com/intro-stat-learning/ISLP_labs/issues/11, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AACTM24CQXNTKOZMYRF5L3LX3M2PHANCNFSM6AAAAAA5ALYKLM. You are receiving this because you are subscribed to this thread.Message ID: @.***>

jonathan-taylor commented 1 year ago

That is v2.1.2​ the version described in our docs.

The stable​ version is https://github.com/intro-stat-learning/ISLP_labs/blob/stable/Ch10-deeplearning-lab.Rmd#L89


From: Jonathan E. Taylor @.> Sent: Wednesday, September 20, 2023 11:48 AM To: intro-stat-learning/ISLP_labs @.>; intro-stat-learning/ISLP_labs @.> Cc: Subscribed @.> Subject: Re: [intro-stat-learning/ISLP_labs] pytorch-lightning version is wrong (Issue #11)

Can you tell me what version of ISLP labs you're running?

Are you running stable​ as indicated here? https://intro-stat-learning.github.io/ISLP/labs.html

If you're running from the PDF there are some changes (you can read about them on the forum on statlearning.com).

The stable​ version of the labs has corrected this import:

https://github.com/intro-stat-learning/ISLP_labs/blob/v2.1.2/Ch10-deeplearning-lab.Rmd#L94

Please let me know if stable​ labs still raise an exception....


From: Kyle @.> Sent: Wednesday, September 20, 2023 11:44 AM To: intro-stat-learning/ISLP_labs @.> Cc: Subscribed @.***> Subject: [intro-stat-learning/ISLP_labs] pytorch-lightning version is wrong (Issue #11)

pytorch_lighting.utilities.seed.seed_everything() appears to have been deprecatedhttps://lightning.ai/docs/pytorch/2.0.0/api/lightning.pytorch.utilities.seed.html#module-lightning.pytorch.utilities.seed in the 2.0 release. For use of this function, latest available version with it is 1.9.5https://lightning.ai/docs/pytorch/2.0.6/api/lightning.pytorch.utilities.seed.html#module-lightning.pytorch.utilities.seed.

This line of code needs to be updated:

https://github.com/intro-stat-learning/ISLP_labs/blob/b5ecc83a950ee4cb9e6a40e697ce062ae74dcb29/requirements.txt#L13

— Reply to this email directly, view it on GitHubhttps://github.com/intro-stat-learning/ISLP_labs/issues/11, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AACTM24CQXNTKOZMYRF5L3LX3M2PHANCNFSM6AAAAAA5ALYKLM. You are receiving this because you are subscribed to this thread.Message ID: @.***>

kylebeni commented 1 year ago

Will try and let you know - I installed directly from pip

jonathan-taylor commented 1 year ago

The pip version is 0.3.19 https://pypi.org/project/ISLP/ (which is the version specified in the docs https://intro-stat-learning.github.io/ISLP/labs.html

It is the version of the labs that this issue arises in -- ISLP does not import seed_everything​ only the lab for Chapter 10.

You can get a tarball with the labs for v2.1.2​ e.g. here: https://github.com/intro-stat-learning/ISLP_labs/releases/tag/v2.1.2


From: Kyle @.> Sent: Wednesday, September 20, 2023 11:58 AM To: intro-stat-learning/ISLP_labs @.> Cc: Jonathan Taylor @.>; Comment @.> Subject: Re: [intro-stat-learning/ISLP_labs] seed_everything() unavailable in requirements.txt pytorch-lightning version (Issue #11)

Will try and let you know - I installed directly from pip

— Reply to this email directly, view it on GitHubhttps://github.com/intro-stat-learning/ISLP_labs/issues/11#issuecomment-1728273247, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AACTM27PQHNHLKYCBOKZKT3X3M4DVANCNFSM6AAAAAA5ALYKLM. You are receiving this because you commented.Message ID: @.***>

kylebeni commented 1 year ago

Thanks. Cloned the repo and am using the updated labs - was referencing the PDF previously which has an outdated import. All good now, appreciate it.

jonathan-taylor commented 1 year ago

[like] Jonathan E. Taylor reacted to your message:


From: Kyle @.> Sent: Wednesday, September 20, 2023 7:20:40 PM To: intro-stat-learning/ISLP_labs @.> Cc: Jonathan Taylor @.>; Comment @.> Subject: Re: [intro-stat-learning/ISLP_labs] seed_everything() unavailable in requirements.txt pytorch-lightning version (Issue #11)

Thanks. Cloned the repo and am using the updated labs - was referencing the PDF previously which has an outdated import. All good now, appreciate it.

— Reply to this email directly, view it on GitHubhttps://github.com/intro-stat-learning/ISLP_labs/issues/11#issuecomment-1728300842, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AACTM2ZFECQMPFFNEX2Z7T3X3M6YRANCNFSM6AAAAAA5ALYKLM. You are receiving this because you commented.Message ID: @.***>

Adarsh0047 commented 11 months ago

I got the same issue when trying to import seed_everything() from pytorch_lightning.utilities.seed. Found out that in the latest version of pytorch_lightning, seed_everything() function was moved to lightning_fabric.fabric. So, basically the import would now look like: from lightning_fabric.fabric import seed_everything