

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>scipy &#8211; Max的程式語言筆記</title>
	<atom:link href="https://stackoverflow.max-everyday.com/tag/scipy/feed/" rel="self" type="application/rss+xml" />
	<link>https://stackoverflow.max-everyday.com</link>
	<description>我要當一個豬頭，快樂過每一天</description>
	<lastBuildDate>Fri, 13 Mar 2020 02:57:38 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://stackoverflow.max-everyday.com/wp-content/uploads/2017/02/max-stackoverflow-256.png</url>
	<title>scipy &#8211; Max的程式語言筆記</title>
	<link>https://stackoverflow.max-everyday.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>[Python] AttributeError: module &#8216;scipy.misc&#8217; has no attribute &#8216;imread&#8217;</title>
		<link>https://stackoverflow.max-everyday.com/2020/03/python-attributeerror-module-scipy-misc-has-no-attribute-imread/</link>
					<comments>https://stackoverflow.max-everyday.com/2020/03/python-attributeerror-module-scipy-misc-has-no-attribute-imread/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Fri, 13 Mar 2020 02:33:58 +0000</pubDate>
				<category><![CDATA[Python筆記]]></category>
		<category><![CDATA[電腦相關應用]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[scipy]]></category>
		<category><![CDATA[tensorflow]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=3285</guid>

					<description><![CDATA[最近在執行別人的程式碼的時候出現了這個錯誤： A...]]></description>
										<content:encoded><![CDATA[
<p>最近在執行別人的程式碼的時候出現了這個錯誤：</p>



<pre class="wp-block-preformatted">AttributeError: module 'scipy.misc' has no attribute 'imread'。<br></pre>



<p>查閱網上資料，有人說要安裝Pillow：</p>



<pre class="wp-block-preformatted">pip install Pillow</pre>



<p>但我已有裝 pillow 7.0.0</p>



<p>我的問題並沒有因此得到解決。</p>



<p>發現是scipy的版本問題， 降級到scipy==1.2.1就可以解決了，指令如下：</p>



<pre class="wp-block-preformatted">pip install scipy==1.2.1</pre>



<hr class="wp-block-separator"/>



<p>imread is deprecated! imread is deprecated in SciPy 1.0.0, and will be removed in 1.2.0. Use imageio.imread instead.</p>



<p>上面的英文說，要改服用 imageio.imread()</p>



<p>把別人的程式硬改成 imageio，可是 scipy 多包的程式就不見了，讓程式走不下去，所以暫時還是降版比較快。</p>



<p>原程式：</p>



<pre class="wp-block-preformatted">mat = misc.imread(img, flatten=True).astype(np.float32)</pre>



<p>錯誤訊息：</p>



<pre class="wp-block-preformatted">File "/Users/chunyuyao/Library/Python/3.7/lib/python/site-packages/imageio/core/format.py", line 221, in <strong>init</strong>
     self._open(**self.request.kwargs.copy())
 TypeError: _open() got an unexpected keyword argument 'flatten'</pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2020/03/python-attributeerror-module-scipy-misc-has-no-attribute-imread/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
