欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

詳談tensorflow gfile文件的用法

 更新時(shí)間:2020年02月05日 15:51:02   作者:cs_程序猿  
今天小編就為大家分享一篇詳談tensorflow gfile文件的用法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來(lái)看看吧

一、gfile模塊是什么

gfile模塊定義在tensorflow/python/platform/gfile.py,但其源代碼實(shí)現(xiàn)主要位于tensorflow/tensorflow/python/lib/io/file_io.py,那么gfile模塊主要功能是什么呢?

google上的定義為:

翻譯過來(lái)為:

沒有線程鎖的文件I / O操作包裝器

...對(duì)于TensorFlow的tf.gfile模塊來(lái)說(shuō)是一個(gè)特別無(wú)用的描述!

tf.gfile模塊的主要角色是:

1.提供一個(gè)接近Python文件對(duì)象的API,以及

2.提供基于TensorFlow C ++ FileSystem API的實(shí)現(xiàn)。

C ++ FileSystem API支持多種文件系統(tǒng)實(shí)現(xiàn),包括本地文件,谷歌云存儲(chǔ)(以gs://開頭)和HDFS(以hdfs:/開頭)。 TensorFlow將它們導(dǎo)出為tf.gfile,以便我們可以使用這些實(shí)現(xiàn)來(lái)保存和加載檢查點(diǎn),編寫TensorBoard log以及訪問訓(xùn)練數(shù)據(jù)(以及其他用途)。但是,如果所有文件都是本地文件,則可以使用常規(guī)的Python文件API而不會(huì)造成任何問題。

以上為google對(duì)tf.gfile的說(shuō)明。

二、gfile API介紹

下面將分別介紹每一個(gè)gfile API!

2-1)tf.gfile.Copy(oldpath, newpath, overwrite=False)

拷貝源文件并創(chuàng)建目標(biāo)文件,無(wú)返回,其形參說(shuō)明如下:

oldpath:帶路徑名字的拷貝源文件;

newpath:帶路徑名字的拷貝目標(biāo)文件;

overwrite:目標(biāo)文件已經(jīng)存在時(shí)是否要覆蓋,默認(rèn)為false,如果目標(biāo)文件已經(jīng)存在則會(huì)報(bào)錯(cuò)

2-2)tf.gfile.MkDir(dirname)

創(chuàng)建一個(gè)目錄,dirname為目錄名字,無(wú)返回。

2-3)tf.gfile.Remove(filename)

刪除文件,filename即文件名,無(wú)返回。

2-4)tf.gfile.DeleteRecursively(dirname)

遞歸刪除所有目錄及其文件,dirname即目錄名,無(wú)返回。

2-5)tf.gfile.Exists(filename)

判斷目錄或文件是否存在,filename可為目錄路徑或帶文件名的路徑,有該目錄則返回True,否則False。

2-6)tf.gfile.Glob(filename)

查找匹配pattern的文件并以列表的形式返回,filename可以是一個(gè)具體的文件名,也可以是包含通配符的正則表達(dá)式。

2-7)tf.gfile.IsDirectory(dirname)

判斷所給目錄是否存在,如果存在則返回True,否則返回False,dirname是目錄名。

2-8)tf.gfile.ListDirectory(dirname)

羅列dirname目錄下的所有文件并以列表形式返回,dirname必須是目錄名。

2-9)tf.gfile.MakeDirs(dirname)

以遞歸方式建立父目錄及其子目錄,如果目錄已存在且是可覆蓋則會(huì)創(chuàng)建成功,否則報(bào)錯(cuò),無(wú)返回。

2-10)tf.gfile.Rename(oldname, newname, overwrite=False)

重命名或移動(dòng)一個(gè)文件或目錄,無(wú)返回,其形參說(shuō)明如下:

oldname:舊目錄或舊文件;

newname:新目錄或新文件;

overwrite:默認(rèn)為false,如果新目錄或新文件已經(jīng)存在則會(huì)報(bào)錯(cuò),否則重命名或移動(dòng)成功。

2-11)tf.gfile.Stat(filename)

返回目錄的統(tǒng)計(jì)數(shù)據(jù),該函數(shù)會(huì)返回FileStatistics數(shù)據(jù)結(jié)構(gòu),以dir(tf.gfile.Stat(filename))獲取返回?cái)?shù)據(jù)的屬性如下:

2-12)tf.gfile.Walk(top, in_order=True)

遞歸獲取目錄信息生成器,top是目錄名,in_order默認(rèn)為True指示順序遍歷目錄,否則將無(wú)序遍歷,每次生成返回如下格式信息(dirname, [subdirname, subdirname, ...], [filename, filename, ...])。

2-13)tf.gfile.GFile(filename, mode)

獲取文本操作句柄,類似于python提供的文本操作open()函數(shù),filename是要打開的文件名,mode是以何種方式去讀寫,將會(huì)返回一個(gè)文本操作句柄。

tf.gfile.Open()是該接口的同名,可任意使用其中一個(gè)!

2-14)tf.gfile.FastGFile(filename, mode)

該函數(shù)與tf.gfile.GFile的差別僅僅在于“無(wú)阻塞”,即該函數(shù)會(huì)無(wú)阻賽以較快的方式獲取文本操作句柄。

三、API源碼

# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""File IO methods that wrap the C++ FileSystem API.
The C++ FileSystem API is SWIG wrapped in file_io.i. These functions call those
to accomplish basic File IO operations.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
 
import os
import uuid
 
import six
 
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.framework import c_api_util
from tensorflow.python.framework import errors
from tensorflow.python.util import compat
from tensorflow.python.util import deprecation
from tensorflow.python.util.tf_export import tf_export
 
 
class FileIO(object):
 """FileIO class that exposes methods to read / write to / from files.
 The constructor takes the following arguments:
 name: name of the file
 mode: one of 'r', 'w', 'a', 'r+', 'w+', 'a+'. Append 'b' for bytes mode.
 Can be used as an iterator to iterate over lines in the file.
 The default buffer size used for the BufferedInputStream used for reading
 the file line by line is 1024 * 512 bytes.
 """
 
 def __init__(self, name, mode):
  self.__name = name
  self.__mode = mode
  self._read_buf = None
  self._writable_file = None
  self._binary_mode = "b" in mode
  mode = mode.replace("b", "")
  if mode not in ("r", "w", "a", "r+", "w+", "a+"):
   raise errors.InvalidArgumentError(
     None, None, "mode is not 'r' or 'w' or 'a' or 'r+' or 'w+' or 'a+'")
  self._read_check_passed = mode in ("r", "r+", "a+", "w+")
  self._write_check_passed = mode in ("a", "w", "r+", "a+", "w+")
 
 @property
 def name(self):
  """Returns the file name."""
  return self.__name
 
 @property
 def mode(self):
  """Returns the mode in which the file was opened."""
  return self.__mode
 
 def _preread_check(self):
  if not self._read_buf:
   if not self._read_check_passed:
    raise errors.PermissionDeniedError(None, None,
                      "File isn't open for reading")
   with errors.raise_exception_on_not_ok_status() as status:
    self._read_buf = pywrap_tensorflow.CreateBufferedInputStream(
      compat.as_bytes(self.__name), 1024 * 512, status)
 
 def _prewrite_check(self):
  if not self._writable_file:
   if not self._write_check_passed:
    raise errors.PermissionDeniedError(None, None,
                      "File isn't open for writing")
   with errors.raise_exception_on_not_ok_status() as status:
    self._writable_file = pywrap_tensorflow.CreateWritableFile(
      compat.as_bytes(self.__name), compat.as_bytes(self.__mode), status)
 
 def _prepare_value(self, val):
  if self._binary_mode:
   return compat.as_bytes(val)
  else:
   return compat.as_str_any(val)
 
 def size(self):
  """Returns the size of the file."""
  return stat(self.__name).length
 
 def write(self, file_content):
  """Writes file_content to the file. Appends to the end of the file."""
  self._prewrite_check()
  with errors.raise_exception_on_not_ok_status() as status:
   pywrap_tensorflow.AppendToFile(
     compat.as_bytes(file_content), self._writable_file, status)
 
 def read(self, n=-1):
  """Returns the contents of a file as a string.
  Starts reading from current position in file.
  Args:
   n: Read 'n' bytes if n != -1. If n = -1, reads to end of file.
  Returns:
   'n' bytes of the file (or whole file) in bytes mode or 'n' bytes of the
   string if in string (regular) mode.
  """
  self._preread_check()
  with errors.raise_exception_on_not_ok_status() as status:
   if n == -1:
    length = self.size() - self.tell()
   else:
    length = n
   return self._prepare_value(
     pywrap_tensorflow.ReadFromStream(self._read_buf, length, status))
 
 @deprecation.deprecated_args(
   None,
   "position is deprecated in favor of the offset argument.",
   "position")
 def seek(self, offset=None, whence=0, position=None):
  # TODO(jhseu): Delete later. Used to omit `position` from docs.
  # pylint: disable=g-doc-args
  """Seeks to the offset in the file.
  Args:
   offset: The byte count relative to the whence argument.
   whence: Valid values for whence are:
    0: start of the file (default)
    1: relative to the current position of the file
    2: relative to the end of file. offset is usually negative.
  """
  # pylint: enable=g-doc-args
  self._preread_check()
  # We needed to make offset a keyword argument for backwards-compatibility.
  # This check exists so that we can convert back to having offset be a
  # positional argument.
  # TODO(jhseu): Make `offset` a positional argument after `position` is
  # deleted.
  if offset is None and position is None:
   raise TypeError("seek(): offset argument required")
  if offset is not None and position is not None:
   raise TypeError("seek(): offset and position may not be set "
           "simultaneously.")
 
  if position is not None:
   offset = position
 
  with errors.raise_exception_on_not_ok_status() as status:
   if whence == 0:
    pass
   elif whence == 1:
    offset += self.tell()
   elif whence == 2:
    offset += self.size()
   else:
    raise errors.InvalidArgumentError(
      None, None,
      "Invalid whence argument: {}. Valid values are 0, 1, or 2."
      .format(whence))
   ret_status = self._read_buf.Seek(offset)
   pywrap_tensorflow.Set_TF_Status_from_Status(status, ret_status)
 
 def readline(self):
  r"""Reads the next line from the file. Leaves the '\n' at the end."""
  self._preread_check()
  return self._prepare_value(self._read_buf.ReadLineAsString())
 
 def readlines(self):
  """Returns all lines from the file in a list."""
  self._preread_check()
  lines = []
  while True:
   s = self.readline()
   if not s:
    break
   lines.append(s)
  return lines
 
 def tell(self):
  """Returns the current position in the file."""
  self._preread_check()
  return self._read_buf.Tell()
 
 def __enter__(self):
  """Make usable with "with" statement."""
  return self
 
 def __exit__(self, unused_type, unused_value, unused_traceback):
  """Make usable with "with" statement."""
  self.close()
 
 def __iter__(self):
  return self
 
 def next(self):
  retval = self.readline()
  if not retval:
   raise StopIteration()
  return retval
 
 def __next__(self):
  return self.next()
 
 def flush(self):
  """Flushes the Writable file.
  This only ensures that the data has made its way out of the process without
  any guarantees on whether it's written to disk. This means that the
  data would survive an application crash but not necessarily an OS crash.
  """
  if self._writable_file:
   with errors.raise_exception_on_not_ok_status() as status:
    ret_status = self._writable_file.Flush()
    pywrap_tensorflow.Set_TF_Status_from_Status(status, ret_status)
 
 def close(self):
  """Closes FileIO. Should be called for the WritableFile to be flushed."""
  self._read_buf = None
  if self._writable_file:
   with errors.raise_exception_on_not_ok_status() as status:
    ret_status = self._writable_file.Close()
    pywrap_tensorflow.Set_TF_Status_from_Status(status, ret_status)
  self._writable_file = None
 
 
@tf_export("gfile.Exists")
def file_exists(filename):
 """Determines whether a path exists or not.
 Args:
  filename: string, a path
 Returns:
  True if the path exists, whether its a file or a directory.
  False if the path does not exist and there are no filesystem errors.
 Raises:
  errors.OpError: Propagates any errors reported by the FileSystem API.
 """
 try:
  with errors.raise_exception_on_not_ok_status() as status:
   pywrap_tensorflow.FileExists(compat.as_bytes(filename), status)
 except errors.NotFoundError:
  return False
 return True
 
 
@tf_export("gfile.Remove")
def delete_file(filename):
 """Deletes the file located at 'filename'.
 Args:
  filename: string, a filename
 Raises:
  errors.OpError: Propagates any errors reported by the FileSystem API. E.g.,
  NotFoundError if the file does not exist.
 """
 with errors.raise_exception_on_not_ok_status() as status:
  pywrap_tensorflow.DeleteFile(compat.as_bytes(filename), status)
 
 
def read_file_to_string(filename, binary_mode=False):
 """Reads the entire contents of a file to a string.
 Args:
  filename: string, path to a file
  binary_mode: whether to open the file in binary mode or not. This changes
    the type of the object returned.
 Returns:
  contents of the file as a string or bytes.
 Raises:
  errors.OpError: Raises variety of errors that are subtypes e.g.
  NotFoundError etc.
 """
 if binary_mode:
  f = FileIO(filename, mode="rb")
 else:
  f = FileIO(filename, mode="r")
 return f.read()
 
 
def write_string_to_file(filename, file_content):
 """Writes a string to a given file.
 Args:
  filename: string, path to a file
  file_content: string, contents that need to be written to the file
 Raises:
  errors.OpError: If there are errors during the operation.
 """
 with FileIO(filename, mode="w") as f:
  f.write(file_content)
 
 
@tf_export("gfile.Glob")
def get_matching_files(filename):
 """Returns a list of files that match the given pattern(s).
 Args:
  filename: string or iterable of strings. The glob pattern(s).
 Returns:
  A list of strings containing filenames that match the given pattern(s).
 Raises:
  errors.OpError: If there are filesystem / directory listing errors.
 """
 with errors.raise_exception_on_not_ok_status() as status:
  if isinstance(filename, six.string_types):
   return [
     # Convert the filenames to string from bytes.
     compat.as_str_any(matching_filename)
     for matching_filename in pywrap_tensorflow.GetMatchingFiles(
       compat.as_bytes(filename), status)
   ]
  else:
   return [
     # Convert the filenames to string from bytes.
     compat.as_str_any(matching_filename)
     for single_filename in filename
     for matching_filename in pywrap_tensorflow.GetMatchingFiles(
       compat.as_bytes(single_filename), status)
   ]
 
 
@tf_export("gfile.MkDir")
def create_dir(dirname):
 """Creates a directory with the name 'dirname'.
 Args:
  dirname: string, name of the directory to be created
 Notes:
  The parent directories need to exist. Use recursive_create_dir instead if
  there is the possibility that the parent dirs don't exist.
 Raises:
  errors.OpError: If the operation fails.
 """
 with errors.raise_exception_on_not_ok_status() as status:
  pywrap_tensorflow.CreateDir(compat.as_bytes(dirname), status)
 
 
@tf_export("gfile.MakeDirs")
def recursive_create_dir(dirname):
 """Creates a directory and all parent/intermediate directories.
 It succeeds if dirname already exists and is writable.
 Args:
  dirname: string, name of the directory to be created
 Raises:
  errors.OpError: If the operation fails.
 """
 with errors.raise_exception_on_not_ok_status() as status:
  pywrap_tensorflow.RecursivelyCreateDir(compat.as_bytes(dirname), status)
 
 
@tf_export("gfile.Copy")
def copy(oldpath, newpath, overwrite=False):
 """Copies data from oldpath to newpath.
 Args:
  oldpath: string, name of the file who's contents need to be copied
  newpath: string, name of the file to which to copy to
  overwrite: boolean, if false its an error for newpath to be occupied by an
    existing file.
 Raises:
  errors.OpError: If the operation fails.
 """
 with errors.raise_exception_on_not_ok_status() as status:
  pywrap_tensorflow.CopyFile(
    compat.as_bytes(oldpath), compat.as_bytes(newpath), overwrite, status)
 
 
@tf_export("gfile.Rename")
def rename(oldname, newname, overwrite=False):
 """Rename or move a file / directory.
 Args:
  oldname: string, pathname for a file
  newname: string, pathname to which the file needs to be moved
  overwrite: boolean, if false it's an error for `newname` to be occupied by
    an existing file.
 Raises:
  errors.OpError: If the operation fails.
 """
 with errors.raise_exception_on_not_ok_status() as status:
  pywrap_tensorflow.RenameFile(
    compat.as_bytes(oldname), compat.as_bytes(newname), overwrite, status)
 
 
def atomic_write_string_to_file(filename, contents, overwrite=True):
 """Writes to `filename` atomically.
 This means that when `filename` appears in the filesystem, it will contain
 all of `contents`. With write_string_to_file, it is possible for the file
 to appear in the filesystem with `contents` only partially written.
 Accomplished by writing to a temp file and then renaming it.
 Args:
  filename: string, pathname for a file
  contents: string, contents that need to be written to the file
  overwrite: boolean, if false it's an error for `filename` to be occupied by
    an existing file.
 """
 temp_pathname = filename + ".tmp" + uuid.uuid4().hex
 write_string_to_file(temp_pathname, contents)
 try:
  rename(temp_pathname, filename, overwrite)
 except errors.OpError:
  delete_file(temp_pathname)
  raise
 
 
@tf_export("gfile.DeleteRecursively")
def delete_recursively(dirname):
 """Deletes everything under dirname recursively.
 Args:
  dirname: string, a path to a directory
 Raises:
  errors.OpError: If the operation fails.
 """
 with errors.raise_exception_on_not_ok_status() as status:
  pywrap_tensorflow.DeleteRecursively(compat.as_bytes(dirname), status)
 
 
@tf_export("gfile.IsDirectory")
def is_directory(dirname):
 """Returns whether the path is a directory or not.
 Args:
  dirname: string, path to a potential directory
 Returns:
  True, if the path is a directory; False otherwise
 """
 status = c_api_util.ScopedTFStatus()
 return pywrap_tensorflow.IsDirectory(compat.as_bytes(dirname), status)
 
 
@tf_export("gfile.ListDirectory")
def list_directory(dirname):
 """Returns a list of entries contained within a directory.
 The list is in arbitrary order. It does not contain the special entries "."
 and "..".
 Args:
  dirname: string, path to a directory
 Returns:
  [filename1, filename2, ... filenameN] as strings
 Raises:
  errors.NotFoundError if directory doesn't exist
 """
 if not is_directory(dirname):
  raise errors.NotFoundError(None, None, "Could not find directory")
 with errors.raise_exception_on_not_ok_status() as status:
  # Convert each element to string, since the return values of the
  # vector of string should be interpreted as strings, not bytes.
  return [
    compat.as_str_any(filename)
    for filename in pywrap_tensorflow.GetChildren(
      compat.as_bytes(dirname), status)
  ]
 
 
@tf_export("gfile.Walk")
def walk(top, in_order=True):
 """Recursive directory tree generator for directories.
 Args:
  top: string, a Directory name
  in_order: bool, Traverse in order if True, post order if False.
 Errors that happen while listing directories are ignored.
 Yields:
  Each yield is a 3-tuple: the pathname of a directory, followed by lists of
  all its subdirectories and leaf files.
  (dirname, [subdirname, subdirname, ...], [filename, filename, ...])
  as strings
 """
 top = compat.as_str_any(top)
 try:
  listing = list_directory(top)
 except errors.NotFoundError:
  return
 
 files = []
 subdirs = []
 for item in listing:
  full_path = os.path.join(top, item)
  if is_directory(full_path):
   subdirs.append(item)
  else:
   files.append(item)
 
 here = (top, subdirs, files)
 
 if in_order:
  yield here
 
 for subdir in subdirs:
  for subitem in walk(os.path.join(top, subdir), in_order):
   yield subitem
 
 if not in_order:
  yield here
 
 
@tf_export("gfile.Stat")
def stat(filename):
 """Returns file statistics for a given path.
 Args:
  filename: string, path to a file
 Returns:
  FileStatistics struct that contains information about the path
 Raises:
  errors.OpError: If the operation fails.
 """
 file_statistics = pywrap_tensorflow.FileStatistics()
 with errors.raise_exception_on_not_ok_status() as status:
  pywrap_tensorflow.Stat(compat.as_bytes(filename), file_statistics, status)
  return file_statistics

以上這篇詳談tensorflow gfile文件的用法就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • python 返回一個(gè)列表中第二大的數(shù)方法

    python 返回一個(gè)列表中第二大的數(shù)方法

    今天小編就為大家分享一篇python 返回一個(gè)列表中第二大的數(shù)方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來(lái)看看吧
    2019-07-07
  • 詳解用python實(shí)現(xiàn)爬取CSDN熱門評(píng)論URL并存入redis

    詳解用python實(shí)現(xiàn)爬取CSDN熱門評(píng)論URL并存入redis

    這篇文章主要介紹了詳解用python實(shí)現(xiàn)爬取CSDN熱門評(píng)論URL并存入redis,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2021-04-04
  • python+selenium+chrome實(shí)現(xiàn)淘寶購(gòu)物車秒殺自動(dòng)結(jié)算

    python+selenium+chrome實(shí)現(xiàn)淘寶購(gòu)物車秒殺自動(dòng)結(jié)算

    這篇文章主要介紹了python+selenium+chrome實(shí)現(xiàn)淘寶購(gòu)物車秒殺自動(dòng)結(jié)算,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2021-01-01
  • Python實(shí)現(xiàn)發(fā)票自動(dòng)校核微信機(jī)器人的方法

    Python實(shí)現(xiàn)發(fā)票自動(dòng)校核微信機(jī)器人的方法

    這篇文章主要介紹了Python實(shí)現(xiàn)發(fā)票自動(dòng)校核微信機(jī)器人的方法,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-05-05
  • 使用pytorch進(jìn)行張量計(jì)算、自動(dòng)求導(dǎo)和神經(jīng)網(wǎng)絡(luò)構(gòu)建功能

    使用pytorch進(jìn)行張量計(jì)算、自動(dòng)求導(dǎo)和神經(jīng)網(wǎng)絡(luò)構(gòu)建功能

    pytorch它是一個(gè)基于Python的開源深度學(xué)習(xí)框架,它提供了兩個(gè)核心功能:張量計(jì)算和自動(dòng)求導(dǎo),這篇文章主要介紹了使用pytorch進(jìn)行張量計(jì)算、自動(dòng)求導(dǎo)和神經(jīng)網(wǎng)絡(luò)構(gòu)建,需要的朋友可以參考下
    2023-04-04
  • python將每個(gè)單詞按空格分開并保存到文件中

    python將每個(gè)單詞按空格分開并保存到文件中

    這篇文章主要介紹了python將每個(gè)單詞按空格分開并保存到文件中,需要的朋友可以參考下
    2018-03-03
  • 如何使用Python?繪制瀑布圖

    如何使用Python?繪制瀑布圖

    這篇文章主要介紹了如何使用Python?繪制瀑布圖,我們一起了解瀑布圖的重要性,以及如何使用不同的繪圖庫(kù)繪制瀑布圖。瀑布圖是一種二維圖表,專門用于了解隨著時(shí)間或多個(gè)步驟或變量的增量正負(fù)變化的影響,下文更多詳細(xì)內(nèi)容需要的小伙伴可以參考一下
    2022-05-05
  • Python使用draw類繪制圖形示例講解

    Python使用draw類繪制圖形示例講解

    這篇文章主要介紹了Python使用draw類繪制圖形的哪些函數(shù),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2022-08-08
  • python 圖片驗(yàn)證碼代碼分享

    python 圖片驗(yàn)證碼代碼分享

    python 圖片驗(yàn)證碼代碼分享,需要的朋友可以參考下
    2012-07-07
  • Pytorch加載圖像數(shù)據(jù)集的方法

    Pytorch加載圖像數(shù)據(jù)集的方法

    這篇文章主要介紹了Pytorch加載圖像數(shù)據(jù)集的方法,加載圖像數(shù)據(jù)集(這里以分類為例),通常都需要經(jīng)過兩個(gè)步驟:定義數(shù)據(jù)集和創(chuàng)建Dataloader數(shù)據(jù)加載器,本文通過代碼示例和圖文講解的非常詳細(xì),需要的朋友可以參考下
    2024-08-08

最新評(píng)論