Python & Getting outside of GH - Grasshopper2024-03-29T04:41:03Zhttps://www.grasshopper3d.com/forum/topics/python-getting-outside-of-gh?groupUrl=owl&feed=yes&xn_auth=noHa, just noticed that Mateusz…tag:www.grasshopper3d.com,2018-06-07:2985220:Comment:19133982018-06-07T10:10:35.369ZSam Gregsonhttps://www.grasshopper3d.com/profile/SamGregson
<p>Ha, just noticed that Mateusz has done something very similar already:</p>
<p><a href="http://www.grasshopper3d.com/video/running-processes-from-gh" target="_blank" rel="noopener">http://www.grasshopper3d.com/video/running-processes-from-gh</a></p>
<p>Ha, just noticed that Mateusz has done something very similar already:</p>
<p><a href="http://www.grasshopper3d.com/video/running-processes-from-gh" target="_blank" rel="noopener">http://www.grasshopper3d.com/video/running-processes-from-gh</a></p> Having given this a go (i.e.…tag:www.grasshopper3d.com,2018-06-06:2985220:Comment:19135132018-06-06T15:17:52.990ZSam Gregsonhttps://www.grasshopper3d.com/profile/SamGregson
<p>Having given this a go (i.e. running TensorFlow within the Python component) I have found the problem...<br></br><br></br>Iron Python, which is used for the standard Python component is not compatible with TensorFlow. Therefore you could use one of the other Python plugins (which unfortunately I have not had much luck with), OR you could potentially have a general purpose py script which you launch from within GH with (for example) a C# script:…</p>
<p></p>
<p style="text-align: left;"></p>
<p>Having given this a go (i.e. running TensorFlow within the Python component) I have found the problem...<br/><br/>Iron Python, which is used for the standard Python component is not compatible with TensorFlow. Therefore you could use one of the other Python plugins (which unfortunately I have not had much luck with), OR you could potentially have a general purpose py script which you launch from within GH with (for example) a C# script:</p>
<p></p>
<p style="text-align: left;"><span style="font-size: 8pt;">string fileName = @"C:\Users\samg\models\samples\core\get_started\premade_estimator.py";</span></p>
<p style="text-align: left;"><span style="font-size: 8pt;">System.Diagnostics.Process p = new System.Diagnostics.Process();</span><br/> <span style="font-size: 8pt;">p.StartInfo = new System.Diagnostics.ProcessStartInfo(@"C:\Users\samg\AppData\Local\Programs\Python\Python36\python.exe", fileName)</span><br/> <span style="font-size: 8pt;">{</span><br/> <span style="font-size: 8pt;">RedirectStandardOutput = true,</span><br/> <span style="font-size: 8pt;">UseShellExecute = false,</span><br/> <span style="font-size: 8pt;">CreateNoWindow = false</span><br/> <span style="font-size: 8pt;">};</span><br/> <span style="font-size: 8pt;">p.Start();</span></p>
<p style="text-align: left;"><span style="font-size: 8pt;">string output = p.StandardOutput.ReadToEnd();</span><br/> <span style="font-size: 8pt;">p.WaitForExit();</span></p>
<p style="text-align: left;"><span style="font-size: 8pt;">A = output;</span></p>
<p style="text-align: left;"></p>
<p style="text-align: left;"><span style="font-size: 10pt;">Here is my result from a running the example file provided by TensorFlow:<br/><br/><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769356383?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769356383?profile=RESIZE_1024x1024" width="721" class="align-full"/></a></span></p>
<p style="text-align: left;"></p>
<p style="text-align: left;"><span style="font-size: 10pt;">So in theory you could construct everything from within GH, run it within GH (given a general purpose py script) and extract results within GH. <br/><br/>Hopefully the OWL components will make this much easier to implement.</span></p> Hi Mateusz,
I would be inter…tag:www.grasshopper3d.com,2018-06-06:2985220:Comment:19131942018-06-06T09:02:23.541ZSam Gregsonhttps://www.grasshopper3d.com/profile/SamGregson
Hi Mateusz,<br />
<br />
I would be interested to learn more about implementing TensorFlow as it appears to give more options. For step 4 that you describe above couldn't this feasibly be done within GH with the python scripting component?<br />
<br />
Sam
Hi Mateusz,<br />
<br />
I would be interested to learn more about implementing TensorFlow as it appears to give more options. For step 4 that you describe above couldn't this feasibly be done within GH with the python scripting component?<br />
<br />
Sam Hey, in the folder you're dow…tag:www.grasshopper3d.com,2017-04-15:2985220:Comment:17335772017-04-15T15:14:42.662ZMateusz Zwierzyckihttps://www.grasshopper3d.com/profile/MateuszZwierzycki
<p>Hey, in the folder you're downloading from food4rhino you'll find the 2 very very basic examples of what Owl can do: regression with neural networks and backpropagation, as well as 6D kmeans clustering. For now I know it's not much but I will add more later when I find some time.</p>
<p>Hey, in the folder you're downloading from food4rhino you'll find the 2 very very basic examples of what Owl can do: regression with neural networks and backpropagation, as well as 6D kmeans clustering. For now I know it's not much but I will add more later when I find some time.</p> Hello , I feel interest on Ow…tag:www.grasshopper3d.com,2017-04-15:2985220:Comment:17332992017-04-15T02:11:31.146ZWinsion Lianghttps://www.grasshopper3d.com/profile/WinsionLiang
<p>Hello , I feel interest on Owl , </p>
<p>I hope to get some example to research what can it do , :-) Thanks</p>
<p>Hello , I feel interest on Owl , </p>
<p>I hope to get some example to research what can it do , :-) Thanks</p>