René's URL Explorer Experiment


Title: pytorch lightning Fail · Issue #263 · clj-python/libpython-clj · GitHub

Open Graph Title: pytorch lightning Fail · Issue #263 · clj-python/libpython-clj

X Title: pytorch lightning Fail · Issue #263 · clj-python/libpython-clj

Description: Following code stop with AttributeError: 'builtin_function_or_method' object has no attribute 'code'. Did you mean: 'call'? (ns pytorchlightning.core (:gen-class) (:require [libpython-clj2.python :as py :refer [ py. py.- as-jvm set-attr!...

Open Graph Description: Following code stop with AttributeError: 'builtin_function_or_method' object has no attribute 'code'. Did you mean: 'call'? (ns pytorchlightning.core (:gen-class) (:require [libpython-clj2.python :...

X Description: Following code stop with AttributeError: 'builtin_function_or_method' object has no attribute 'code'. Did you mean: 'call'? (ns pytorchlightning.core (:gen-class) (:require ...

Opengraph URL: https://github.com/clj-python/libpython-clj/issues/263

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pytorch lightning Fail","articleBody":"Following code stop with \r\n\u003e AttributeError: 'builtin_function_or_method' object has no attribute '__code__'. Did you mean: '__call__'?\r\n\r\n```clojure\r\n(ns pytorchlightning.core\r\n  (:gen-class)\r\n\r\n  (:require \r\n   [libpython-clj2.python :as py\r\n    :refer\r\n    [ py. py.- \r\n     as-jvm\r\n     set-attr!\r\n     get-item\r\n     -\u003epy-tuple\r\n     -\u003epy-list\r\n     ]]\r\n   \r\n   [libpython-clj2.require :refer [require-python]]\r\n   ))\r\n\r\n;;(py/initialize!)\r\n\r\n(require-python\r\n '[builtins :as python]\r\n '[torch]\r\n '[torch.nn :as nn :refer [Linear]]\r\n '[torch.nn.functional :refer [mse_loss]]\r\n '[torch.utils.data :refer [DataLoader Dataset]]\r\n '[torch.optim]\r\n '[pytorch_lightning]\r\n )\r\n\r\n\r\n(defonce model (atom nil))\r\n\r\n(def LitModel\r\n  (py/create-class\r\n   \"LitModel\" [pytorch_lightning/LightningModule]\r\n   {\"__init__\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self]\r\n       (py. pytorch_lightning/LightningModule  __init__ self)\r\n       (py/set-attr!  self \"layer\" (Linear 1 1))\r\n       nil))\r\n    \r\n    \"forward\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self x] (py. self layer x))\r\n     :arg-converter as-jvm\r\n     :method-name \"forward\"\r\n     )\r\n    \r\n    \"training_step\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self batch batch_idx]\r\n       (mse_loss (py/get-item batch 1) (py. self forward (py/get-item batch 0)))\r\n       ))\r\n    \"validation_step\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self batch batch_idx]\r\n       (mse_loss (py/get-item batch 1) (py. self forward (py/get-item batch 0)))\r\n       ))\r\n    \"test_step\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self batch batch_idx]\r\n       (mse_loss (py/get-item batch 1) (py. self forward (py/get-item batch 0)))\r\n       ))\r\n    \r\n    \"configure_optimizers\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self]\r\n       (torch.optim/SGD\r\n        (py. self parameters)\r\n        :lr 0.02)\r\n       ))\r\n    }))\r\n\r\n(def SimpleDataset\r\n  (py/create-class\r\n   \"SimpleDataset\" [Dataset]\r\n   {\"__init__\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self data] (py/set-attr! self \"data\" data)  nil))\r\n    \"__len__\"\r\n    (py/make-tuple-instance-fn \r\n     (fn [self] (python/len (py.- self data))))\r\n    \"__getitem__\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self idx]\r\n       (py/-\u003epy-tuple\r\n        [\r\n         (torch/tensor [(py/get-item  (py/get-item (py.- self data) idx) 0)] :dtype torch/float32)\r\n         (torch/tensor [(py/get-item  (py/get-item (py.- self data) idx) 1)] :dtype torch/float32)\r\n         ]\r\n        )\r\n       ))\r\n    }))\r\n\r\n\r\n(def SimpleDataModule\r\n  (py/create-class\r\n   \"SimpleDataModule\" [pytorch_lightning/LightningDataModule]\r\n   {\"__init__\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self data] (py/set-attr! self \"data\" data)  nil))\r\n    \r\n    \"train_dataloader\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self]\r\n       (DataLoader (SimpleDataset (py.- self data )) :batch_size 2 :shuffle false)))\r\n    \"val_dataloader\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self]\r\n       (DataLoader (SimpleDataset (py.- self data )) :batch_size 2 :shuffle false)))\r\n    \"test_dataloader\"\r\n    (py/make-tuple-instance-fn\r\n     (fn [self]\r\n       (DataLoader (SimpleDataset (py.- self data )) :batch_size 2 :shuffle false)))\r\n    }))\r\n\r\n\r\n\r\n\r\n(defn -main [\u0026 args]\r\n\r\n  (reset! model (LitModel))\r\n\r\n  (def data [[1.0 3.0] [2.0 5.0] [3.0 7.0] [4.0 9.0] [5.0 11.0]] )\r\n  (def data_pylist (py/-\u003epy-list data))\r\n\r\n  ;; (println  (py/get-item  (py/get-item data_pylist 0) 0))\r\n\r\n  (def train_dataset  (SimpleDataset data_pylist))\r\n  (def train_loader (DataLoader train_dataset :batch_size 2 :shuffle false))\r\n\r\n  ;; ;;for debug\r\n  ;; (def train_pylist (python/list train_loader))\r\n  ;; (def train_pylist_0 (py/get-item train_pylist 0))\r\n  ;; (println (py. @model training_step train_pylist_0 0) );;;OK.  maybe this part work\r\n\r\n  \r\n  (def trainer (pytorch_lightning/Trainer :max_epochs 10 ))\r\n\r\n  (def datamodu (SimpleDataModule data_pylist))\r\n  \r\n  (py. trainer fit @model train_loader)\r\n  ;;(py. trainer fit @model datamodu)  ;;also fail\r\n\r\n  )\r\n\r\n\r\n```\r\n","author":{"url":"https://github.com/niitsuma","@type":"Person","name":"niitsuma"},"datePublished":"2024-06-18T12:42:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/263/libpython-clj/issues/263"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:dc1424d1-0ca4-8833-162e-77d0aa2d37bd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9E98:4B5E5:1AA1C37:26E590E:6A60B0FA
html-safe-noncef63e538f961291fc060975787d43e0740ca0cb0cd14ff81dfaff0d094017be71
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTk4OjRCNUU1OjFBQTFDMzc6MjZFNTkwRTo2QTYwQjBGQSIsInZpc2l0b3JfaWQiOiI3NDQ5MDIxOTYzNzY2Mzc4NzQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacf2df8ede5f2f50d758bee789cb37019e05bde1710416ef6f73c644fc85cbda64
hovercard-subject-tagissue:2359774617
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/clj-python/libpython-clj/263/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2db8d65b5262e1acdd638a86ea1fc2b3725b16d18352ad750ce4280706ebce8e/clj-python/libpython-clj/issues/263
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2db8d65b5262e1acdd638a86ea1fc2b3725b16d18352ad750ce4280706ebce8e/clj-python/libpython-clj/issues/263
og:image:altFollowing code stop with AttributeError: 'builtin_function_or_method' object has no attribute 'code'. Did you mean: 'call'? (ns pytorchlightning.core (:gen-class) (:require [libpython-clj2.python :...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameniitsuma
hostnamegithub.com
expected-hostnamegithub.com
None35671f8a6946a7a2a81d51ae49f5465bdc5f925c23c9cb839206b24345dbe8d9
turbo-cache-controlno-preview
go-importgithub.com/clj-python/libpython-clj git https://github.com/clj-python/libpython-clj.git
octolytics-dimension-user_id60827878
octolytics-dimension-user_loginclj-python
octolytics-dimension-repository_id187095617
octolytics-dimension-repository_nwoclj-python/libpython-clj
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id187095617
octolytics-dimension-repository_network_root_nwoclj-python/libpython-clj
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release746dc49090e6e3995bb502dce0f8807393e36eda
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/clj-python/libpython-clj/issues/263#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fclj-python%2Flibpython-clj%2Fissues%2F263
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fclj-python%2Flibpython-clj%2Fissues%2F263
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=clj-python%2Flibpython-clj
Reloadhttps://github.com/clj-python/libpython-clj/issues/263
Reloadhttps://github.com/clj-python/libpython-clj/issues/263
Reloadhttps://github.com/clj-python/libpython-clj/issues/263
Please reload this pagehttps://github.com/clj-python/libpython-clj/issues/263
clj-python https://github.com/clj-python
libpython-cljhttps://github.com/clj-python/libpython-clj
Please reload this pagehttps://github.com/clj-python/libpython-clj/issues/263
Notifications https://github.com/login?return_to=%2Fclj-python%2Flibpython-clj
Fork 74 https://github.com/login?return_to=%2Fclj-python%2Flibpython-clj
Star 1.2k https://github.com/login?return_to=%2Fclj-python%2Flibpython-clj
Code https://github.com/clj-python/libpython-clj
Issues 33 https://github.com/clj-python/libpython-clj/issues
Pull requests 4 https://github.com/clj-python/libpython-clj/pulls
Actions https://github.com/clj-python/libpython-clj/actions
Projects https://github.com/clj-python/libpython-clj/projects
Security and quality 0 https://github.com/clj-python/libpython-clj/security
Insights https://github.com/clj-python/libpython-clj/pulse
Code https://github.com/clj-python/libpython-clj
Issues https://github.com/clj-python/libpython-clj/issues
Pull requests https://github.com/clj-python/libpython-clj/pulls
Actions https://github.com/clj-python/libpython-clj/actions
Projects https://github.com/clj-python/libpython-clj/projects
Security and quality https://github.com/clj-python/libpython-clj/security
Insights https://github.com/clj-python/libpython-clj/pulse
pytorch lightning Failhttps://github.com/clj-python/libpython-clj/issues/263#top
https://github.com/niitsuma
niitsumahttps://github.com/niitsuma
on Jun 18, 2024https://github.com/clj-python/libpython-clj/issues/263#issue-2359774617
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.