artificial-intelligence

How to read bucket image from AWS S3 into Sagemaker Jupyter Instance

蓝咒 提交于 2021-01-29 15:33:29
问题 I am very new to AWS and the cloud environment. I am a machine learning engineer, I am planning to build a custom CNN into the AWS environment to predict a given image has an iPhone present or not. What I have done: Step 1: I have created a S3 bucket for iPhone classifier with the below folder structure : Iphone_Classifier > Train > Yes_iphone_images > 1000 images > No_iphone_images > 1000 images > Dev > Yes_iphone_images > 100 images > No_iphone_images > 100 images > Test > 30 random images

How to compensate if I cant do a large batch size in neural network

大城市里の小女人 提交于 2021-01-29 05:34:44
问题 I am trying to run an action recognition code from GitHub. The original code used a batch size of 128 with 4 GPUS. I only have two gpus so I cannot match their bacth size number. Is there anyway I can compensate this difference in batch. I saw somewhere that iter_size might compensate according to a formula effective_batchsize= batch_size*iter_size*n_gpu . what is iter_size in this formula? I am using PYthorch not Caffe. 回答1: In pytorch, when you perform the backward step (calling loss

Can I import tensorflow and keras in Maya , Blender

▼魔方 西西 提交于 2021-01-28 18:52:06
问题 I am participating in a workshop , where we need to automatically rig characters . Perhaps , we will use deep learning methods . The task is to recognize body parts . My question : Is there a way for connecting tensorflow and keras , or other neural networks with 3D software? 回答1: For blender you can follow this tutorial, https://www.youtube.com/watch?v=J7Iu1rfwbds I tested it in Blender 2.81 and Python 3.7 by importing pytorch, opencv, sklearn etc. Also the test code provided in the video

Loading a huge dataset batch-wise to train pytorch

老子叫甜甜 提交于 2021-01-28 05:59:30
问题 I am training a LSTM in-order to classify the time-series data into 2 classes(0 and 1).I have huge data-set on the drive where where the 0-class and the 1-class data are located in different folders.I am trying to train the LSTM batch-wise using by creating a Dataset class and wrapping the DataLoader around it. I have to do pre-processing such as reshaping.Here's my code which does that ` class LoadingDataset(Dataset): def __init__(self,data_root1,data_root2,file_name): self.data_root1=data

How to merge contours in opencv?

六月ゝ 毕业季﹏ 提交于 2021-01-28 02:50:33
问题 Ok guys I have been working on this project for quite some time now. I am building this bot that plays the chrome dinosaur game. So I tried other methods to detect the characters like matchTemplate and even made my own algorithm to locate the objects, but I like this one (findcontours) the most. Here's what I have: Can anyone help me find out how I should merge the two rectangles of the cacti? img = screen_cap() roi = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret, thresh = cv2.threshold(roi,127,

How to implement a transposition table for connect 4?

帅比萌擦擦* 提交于 2021-01-27 08:00:07
问题 I'm making a connect 4 AI in python, and I'm using minimax with iterative deepening and alpha beta pruning for this. For greater depths it's still quite slow, so I wanted to implement a transposition table. After reading up on it I think i get the general idea but i haven't been able to quite make it work. Here's part of my code: (the maximizing part of the minimax): if(isMaximizing): maxEval = -99999999999 bestMove = None # cache.get(hash(board)) Here's where i'd check to see if the hash is

How to implement a transposition table for connect 4?

寵の児 提交于 2021-01-27 07:56:04
问题 I'm making a connect 4 AI in python, and I'm using minimax with iterative deepening and alpha beta pruning for this. For greater depths it's still quite slow, so I wanted to implement a transposition table. After reading up on it I think i get the general idea but i haven't been able to quite make it work. Here's part of my code: (the maximizing part of the minimax): if(isMaximizing): maxEval = -99999999999 bestMove = None # cache.get(hash(board)) Here's where i'd check to see if the hash is

TypeError: __init__() missing 1 required positional argument: 'units'

半城伤御伤魂 提交于 2021-01-24 11:39:11
问题 I am working in python and tensor flow but I miss 'units' argument and I do not know how to solve it, It looks like your post is mostly code; please add some more details.It looks like your post is mostly code; please add some more details. here the code def createModel(): model = Sequential() # first set of CONV => RELU => MAX POOL layers model.add(Conv2D(32, (3, 3), padding='same', activation='relu', input_shape=inputShape)) model.add(Conv2D(32, (3, 3), activation='relu')) model.add

TypeError: __init__() missing 1 required positional argument: 'units'

[亡魂溺海] 提交于 2021-01-24 11:37:40
问题 I am working in python and tensor flow but I miss 'units' argument and I do not know how to solve it, It looks like your post is mostly code; please add some more details.It looks like your post is mostly code; please add some more details. here the code def createModel(): model = Sequential() # first set of CONV => RELU => MAX POOL layers model.add(Conv2D(32, (3, 3), padding='same', activation='relu', input_shape=inputShape)) model.add(Conv2D(32, (3, 3), activation='relu')) model.add

Converting zoo object into a weekly time series

牧云@^-^@ 提交于 2021-01-07 02:48:26
问题 I am working on building a time series in R programming language. I m having a zoo object which is follows: I 'd like to convert this into a weekly time series data for analysis and typed in the following code tt2<-as.ts(zz,freq=365.25/7,start=decimal_date(ymd("2018-01-01"))) tt2[is.na(tt2)]<-0 However, I get the following output: Time Series: Start = 17538 End = 18532 Frequency = 0.142857142857143 While I'd like to see the output in line with something like this: Time Series: Start = c(2018